sindresorhus / get-stream

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

Allow multiple readers at once #121

Closed ehmicky closed 7 months ago

ehmicky commented 7 months ago

Fixes #119.

I checked Node.js default iterable Readable[Symbol.asyncIterator] (source here), for comparison.

I believe the new behavior to be fairly close to the previous behavior, except that multiple concurrent readers are now possible. That being said, there are slight differences, such as:

For most users, this should not matter, but to be on the safe side, this probably should be in a major release. We probably should try to solve https://github.com/sindresorhus/get-stream/issues/116 as part of that major release (I am looking into it right now).

Note: to double check, I also ran this PR against Execa automated tests, and they all passed.