jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.07k stars 217 forks source link

FS createReadStream not supported? #217

Closed nicmosc closed 5 years ago

nicmosc commented 6 years ago

I can't seem to get the createReadStream function to work and I'm getting a ENOTSUP error. I assume it's because this method hasn't been implemented?

I would need this to stream the files to an S3 uploader (not from the official aws sdk). If streams are not yet supported how would I go about doing something like this? Reading from the dir with the s3 client fails as they have their own custom fs dependency.

jvilk commented 6 years ago

createReadStream is on the roadmap for the next major release, and I don't have an ETA for it due to other commitments.

You could consider writing a simple polyfill for your current needs, e.g. that uses readFile to read a file into a buffer, pushes it into a NodeJS readable stream, and ends the stream. Just overwrite the supplied stub that throws ENOTSUP with that code.

rektide commented 6 years ago

Duplicate of #124.