electron-userland / electron-json-storage

:package: Easily write and read user settings in Electron apps
1.43k stars 79 forks source link

How set path in electron app ? #162

Closed zababurinsv closed 3 years ago

zababurinsv commented 3 years ago

My folder structure looked like this.


parent-folder
/docs
/storage
  /words.json
server.js
 storage.setDataPath(`${process.cwd()}/storage`);

How can i setDataPath inside my application in dir storage/words.json ?

jviotti commented 3 years ago

@zababurinsv I'm not sure I understand the question. Did you manage to resolve it? Can you elaborate otherwise?

How can i setDataPath inside my application in dir storage/words.json

Are you trying to set the data path to be inside the application along with the source code? If so, keep in mind that this will not play nicely in production as your application will likely be code-signed and therefore must be treated as read-only, else the signature will break.