Chidi Williams
Chidi Williams

Reputation: 399

How do I save large files in Electron?

I am building an app with Electron that searches through a JSON object with Elasticlunr and prints to the HTML page. The JSON file is about 9 MB. The object needs to be loaded only once the first time the app starts. How can I store and retrieve this JSON object?

I have tried:

Upvotes: 1

Views: 867

Answers (1)

sleigh_bells
sleigh_bells

Reputation: 126

You can use the Node's native fs module to save onto the client's computer as a stringified version.

Another thing you could do is use something like sqlite to set up a local database on the user's computer if you plan on doing any querying of that JSON.

Upvotes: 1

Related Questions