Advantages over localStorage
pannous opened this issue ยท 5 comments
pannous commented
why not just use window.localStorage?
sindresorhus commented
Many reasons:
localStorage
only works in the browser process.localStorage
is not very fault tolerant, so if your app encounters an error and quits unexpectedly, you could lose the data.localStorage
only supports persisting strings. This module supports any JSON supported type.- The API of this module is much nicer. You can set and get nested properties. You can set default initial config.
pannous commented
okay nice!!
I suggests to copy this list to the readme.md
paranoidjk commented
IMO๏ผlocalStorage
is not very safe, it may be leak through xss attack.
rnmp commented
Another advantage is subscriptions!
timfish commented
It's also worth noting that localStorage
and indexedDb
data can be lost if a user installs an older version of your app which uses an older version of Electron.
Chromium only caters for upgrades to the underlying levelDb store. If you run a previous version of Electron, it can fail to read the levelDb store and deletes it to start again from scratch!