Deprecated. I decided not to statically transform the code, but to make fs-read-stream-over-http
isomorphic.
Browserify transform to replace fs.createReadStream by fs-read-stream-over-http
, which uses HTTP GET
requests.
npm install --save-dev browser-fs-read-stream
// index.js
const fs = require('fs')
fs.createReadStream('foo.txt', {encoding: 'utf8'})
.on('data', console.log)
browserify -t browser-fs-read-stream index.js >bundle.js
// bundle.js
// …
const fs = require('fs')
fsReadStreamOverHttp('foo.txt', {encoding: 'utf8'})
.on('data', console.log)
// …
If you have a question or have difficulties using browser-fs-read-stream
, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.