-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Streams: support ReadableStream.from()
#48389
Comments
This is very similar to Node's import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web';
const nodeReadable = new Readable({ /* ... */ });
const webReadableStreamFromNodeReadable = ReadableStream.from(nodeReadable);
const webReadableStream = new ReadableStream({ /* ... */ });
const nodeReadableFromWebReadableStream = Readable.from(webReadableStream); Also, |
Hey! will give this a try hoping to have a PR ready soon! |
Fixes: nodejs#48389 PR-URL: nodejs#48395 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#48389 PR-URL: nodejs#48395 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#48389 PR-URL: nodejs#48395 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#48389 PR-URL: nodejs#48395 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Fixes: nodejs#48389 PR-URL: nodejs#48395 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
The Streams standard has been updated with a new utility method
ReadableStream.from(asyncIterable)
, which adapts any sync or async iterable into aReadableStream
.Specification: https://streams.spec.whatwg.org/#rs-from
Spec change: whatwg/streams#1083
WPT tests: web-platform-tests/wpt#27009
The text was updated successfully, but these errors were encountered: