Borewit / readable-web-to-node-stream

Converts a Web-API readable-stream into a Node readable-stream.
44 stars 8 forks source link

you know that there is a built in option for this... right? #724

Open jimmywarting opened 2 years ago

jimmywarting commented 2 years ago

stream.Readable.fromWeb(readableStream[, options])

https://nodejs.org/dist/latest-v18.x/docs/api/stream.html#streamreadablefromwebreadablestream-options

rektide commented 1 year ago

This is still potentially useful for projects like https://github.com/isomorphic-git/lightning-fs , which are trying to ponyfill out a Node.js fs implementation from within the browser.

AFAIK there's no way to use any Node.js code in the browser. It'd be awesome if some of the Node.js JS implementations were available as standalone modules via npm.

ecofi commented 6 months ago

@jimmywarting this module is helpful for browser bundler such as webpack because module "readable-stream" has not yet implemented the latest Readable Nodejs API.

faridnsh commented 4 months ago

stream.Readable.fromWeb is experimental and it could change between node version changes. This project provides a stable interface to it that you don't have to worry about when changing between node versions.