1

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:

  • Saving the object as the export of a JS file and importing into the window's main Javascript file
  • Electron-storage and Electron-json-storage don't seem to be for such large files
Chidi Williams
  • 399
  • 6
  • 16

1 Answers1

1

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.

sleigh_bells
  • 126
  • 2
  • 7