sindresorhus / get-stream

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

Do not use the `readable` event #5

Closed julien-f closed 8 years ago

julien-f commented 8 years ago

I am not an expert on streams but I do believe that it should be possible to open a stream and read from it later (for instance an async function could return the stream wrapped in a promise).

Unfortunately it cannot work with this module because the readable event may have already been emitted. IMHO the best way to achieve what you want is by using the stream in flow mode.