sindresorhus / get-stream

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

Expose `getBufferStream()` #37

Closed ehmicky closed 1 year ago

ehmicky commented 4 years ago

The getBufferStream() method is very useful on its own, so should probably be exposed, or put in its own library (without pump).

I have the following use case: a readable stream (HTTP download) that must be piped to a writable stream (writing to a local file). However I also want to retrieve the full content of that stream, so a PassThrough needs to be in the middle. This is basically what getBufferStream() is doing in this package.

Note: it would be nice to get the maxBuffer feature moved to getBufferStream() as well.

sindresorhus commented 4 years ago

How about exposing it as a .bufferStream() method here?

pump is going away with #21.


Note: it would be nice to get the maxBuffer feature moved to getBufferStream() as well.

👍

sindresorhus commented 1 year ago

I have decided not to do this as the buffer stream is no longer used here. I think it's better to make it a separate package.