sindresorhus / get-stream

Get a stream as a string, Buffer, ArrayBuffer or array
MIT License
341 stars 33 forks source link

use readable-stream in the browser #27

Closed hugomrdias closed 5 years ago

hugomrdias commented 5 years ago

would you consider a PR to alias 'stream': 'readable-stream' only for the browser? This way we don't rely on bundlers choosing the polyfill, also webpack 5 will stop doing so.

sindresorhus commented 5 years ago

Sorry, no. That would make it a dependency for Node.js. Something I don't want.

sindresorhus commented 5 years ago

also webpack 5 will stop doing so.

That's not final yet.

hugomrdias commented 5 years ago

a dependency for node ? it would be in the package.json yes but node would still run require('stream') if we do

"browser": {
    "stream": "readable-stream"
},
sindresorhus commented 5 years ago

Yes, but it would have to be in the dependencies field, which means Node.js users would have to install and waste space on it, even if it's not require()d.

hugomrdias commented 5 years ago

imo being browser friendly is worth the extra bytes, but i understand. ty

ehmicky commented 1 year ago

ReadableStream is not supported in the latest version of this package. (#82).