Skip to content

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

@dreamofi

Description

@dreamofi

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions