node.js - node-webkit windows build where to store persistent data? -


i building desktop app node-webkit. have used nw-builder build windows 32 & windows 64 bit mac. program working fine in windows except files use store data gone upon program exit.

the app packed .pak file , assuming when program closed , files along erased. when start app again , persisted data gone.

how can persist data in windows node-webkit ?

i using 'node-persist' package persistence. in mac creating folder called 'persist' inside .app file , writing files works fine.

but in windows , due .pak file , persisted files lost when program closed. how fix ? there way to store files outside .pak. .pak seems extracted temp location.

update ( solved )

i have used app.datapath described in https://github.com/nwjs/nw.js/wiki/app

excerpt :

get application's data path in user's directory. windows: %localappdata%/; linux: ~/.config/; osx: ~/library/application support/ field in manifest.

popcorntime uses same in database.js file. https://git.popcorntime.io/popcorntime/desktop/blob/master/src/app/database.js

you have multiple options:

https://github.com/nwjs/nw.js/wiki/save-persistent-data-in-app

personally, used localstorage. simple needs, it's easy , mimics browser behaviour.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -