Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support async iteration #23

Open
timwis opened this issue May 11, 2020 · 1 comment
Open

Support async iteration #23

timwis opened this issue May 11, 2020 · 1 comment

Comments

@timwis
Copy link

timwis commented May 11, 2020

Hello! I've noticed that streams created with this library do not support async iteration. This appears to be because it depends on readable-stream v2.x.x, and Symbol.asyncIterator was added to that library in v3.x.x, when it started supporting Node v10. I noticed in #21 that there was reluctance to upgrade to readable-stream v3.x.x, but that was more than a year and a half ago.

Would you be open to a PR that updates the dependency? Or does that issue still remain? Alternatively, any suggestions for how I might support async iteration in streams created by this library?

@seriousme
Copy link

seriousme commented Apr 17, 2022

Async iteration can easily be fixed by:

const legacyStream = from2([opts], read)
const modernStream = (new Readable({objectMode:true}).wrap(legacyStream))

See also: #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants