localStorage when app is deleted?


#1

Hi,
I’ve compiled and started an electron app, saved some data in localStorage, then removed and recreated the app. I started the new app and found out that there are saved localStorage data from previous app.

My question is, where are localStorage data really stored and how can I remove them (from hard drive)?

Thanks
Petr


#2

You can find this from the main process using require('app').getPath('userData')


#3

On windows I have the following atom directory

  • C:\Users\%USERNAME%\.atom

    • contains user style sheet / package
  • C:\Users\%USERNAME%\AppData\Roaming\Atom

    • contains localDB, indexedDB and a few other cache things
  • C:\Users\%USERNAME%\AppData\Local\atom

    • contains binary, multiple version.

Electron may follow a similar path than atom.


EDIT: caffiend solution is probably the best for future and cross platform.
Altougth there’s a local storage folder at equal level than the cache folder (not as a subfolder of cache)


#4

Hi, I am curious about the question. Will the indexedDB and LocalStorage data stayed while the App is deleted? What if I reinstalled the same App, will the data inside indexedDB and LocalStorage will be available in the new installation?

Thanks.