Save data in JSON file - Electron


#1

I have created a empty json file and stored inside a folder.
example.json - {“orders”:[]}
While running from node it works fine. I can save the data in json file, also I can read the data. But after building(build -w) and installed in a system I can save the data and read the data till the application is open. But once close the application and again open it I can’t read the old data, Its again empty. I


#2

I’ve had this problem before, and maybe you can try the electron-store plug-in. Packaged applications, all files contained in app will be reset to the previous contents after the program closes.