get-stream does not depend on any Node.js specific imports anymore, with the exception of Buffer.
Buffer is only used with getStreamAsBuffer(). getStreamAsArrayBuffer() can be used instead as an alternative that does not rely on Node.js Buffer.
This PR uses Buffer through globalThis.Buffer instead of import { Buffer } from 'node:buffer' to make it simpler for any JavaScript environment to use get-stream (without any bundler nor shims). It does not remove Buffer support, since this is still useful in a Node.js context.
This makes get-stream now available in any JavaScript environment.
get-stream
does not depend on any Node.js specific imports anymore, with the exception ofBuffer
.Buffer
is only used withgetStreamAsBuffer()
.getStreamAsArrayBuffer()
can be used instead as an alternative that does not rely on Node.jsBuffer
.This PR uses
Buffer
throughglobalThis.Buffer
instead ofimport { Buffer } from 'node:buffer'
to make it simpler for any JavaScript environment to useget-stream
(without any bundler nor shims). It does not removeBuffer
support, since this is still useful in a Node.js context.This makes
get-stream
now available in any JavaScript environment.