Save data in JSON file - Electron


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


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.