Closed sindresorhus closed 1 year ago
It's in Node.js now.
Hi @sindresorhus ,
Would you still like this issue worked on? If so, what is your goal for updating the implementation to use for-await? Remove the dependency on pump
?
Yes, it can be worked on, but we can’t release it until after December when Node.js 8 is no longer LTS, since we need to target Node.js 10 for this. https://github.com/nodejs/Release The goal is to remove the pump dependency and simplify the code.
This can be worked on now.
I tried to migrate to use for-await here. It worked for PassThrough
and fs streams inputs, however for every test that used into-stream
it didn't work - the error thrown was:
inputStream is not async iterable
✖ get object stream as an array Rejected promise returned by test
✖ get non-object stream as an array of strings Rejected promise returned by test
✖ get non-object stream as an array of Buffers Rejected promise returned by test
✖ getStream should not affect additional listeners attached to the stream Rejected promise returned by test
✖ maxBuffer throws a MaxBufferError
✖ maxBuffer applies to length of arrays when in objectMode
✖ maxBuffer throws when size is exceeded
✖ maxBuffer applies to length of data when not in objectMode
✔ Promise rejects when input stream emits an error
✔ get stream as a buffer
✔ get stream as an array
I didn't investigated it further though to discover why the into-stream
streams weren't async iterables.
When it's in a Node.js version we can target: https://github.com/nodejs/node/commit/61b4d60c5d9694e79069b1680b3736c96a5de501