You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Streams standard has been updated with a new utility method ReadableStream.from(asyncIterable), which adapts any sync or async iterable into a ReadableStream.
This is very similar to Node's Readable.from(iterable), except for Web Streams. And because both Readable and ReadableStream are async iterables and have a static from() method, there's a nice duality for converting them:
Also, Readable.toWeb(nodeReadable) will be equivalent to ReadableStream.from(nodeReadable) (although the former can be optimized specifically for Node streams, whereas the latter is more general).
Activity
MattiasBuelens commentedon Jun 8, 2023
This is very similar to Node's
Readable.from(iterable), except for Web Streams. And because bothReadableandReadableStreamare async iterables and have a staticfrom()method, there's a nice duality for converting them:Also,
Readable.toWeb(nodeReadable)will be equivalent toReadableStream.from(nodeReadable)(although the former can be optimized specifically for Node streams, whereas the latter is more general).debadree25 commentedon Jun 8, 2023
Hey! will give this a try hoping to have a PR ready soon!
stream: implement ReadableStream.from
stream: implement ReadableStream.from
stream: implement ReadableStream.from
stream: implement ReadableStream.from
stream: implement ReadableStream.from