Skip to content
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

How do you dump db to a download stream with streamsaver in Browser? #82

Open
dreamofi opened this issue May 10, 2020 · 0 comments
Open

Comments

@dreamofi
Copy link

dreamofi commented May 10, 2020

Hello,

I am trying to dump a db directly to a file for download using streamsaver in the browser (I use React), however, it does not work and the error is "dest.on is not a function". I guess it is because I use web-stream ponyfill which does not have the on() method on the stream.

Currently, I am dumping the db to a string with memorystream, and then create a blob from the string and stream it to streamsaver's writableStream. I think as the db can be large, the memory needed to store the string will be significant.

So, do you guys know of a way/lib to dump a db to a file directly in a browser (where fs.createWriteStream is unavailable) without memorystream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant