Search code examples
javascriptnode.jscachinglocal-storagenode-webkit

NW.js Local Storage Cache Still Persists Even After App Uninstallation


In my NW.js app, I store some data in the Local Storage. Now I want to delete the app and surely the Local Storage data as well. I move the app to the trash and clean it up. Also, I delete cache information related to the app located in /Users/<username>/Library/Caches/<yourmagicapp>.

But unfortunately, all this doesn't help. After building a new copy of the app and shipping it to the macOS Application folder the Local Storage data restores from somewhere like it never has been deleted at all. All the data still here.

The question is how to delete all the stored data and where does it sit? Or at least from where to read about it because I couldn't find information in the nw.js official docs. Thank you.


Solution

  • You can find the location of the local app data on any OS by doing console.log(nw.App.dataPath);. This folder is created automatically by Chromium and exists separately from your app in a user account specific location. When you delete the app, this folder remains because it may contain settings, in case you reinstall it or replace it with a newer version of the app.