title: How to remove all Electron bloatware on exit?
body: <p>How can I remove cookies, local storage and other crap from the &quot;AppData\roaming\MyApp&quot; folder, when the electron application quits?</p>
  <p>I tried deleting the whole directory on app quit, but it throws me EBUSY errors. Apparently the files are locked or something, almost like someone doesn't want us to be able to remove the bloat?</p>
  <pre><code>const fs = require('fs-extra');
  
  const clearBloat = async () =&gt; fs.remove(path.join(app.getPath('appData'), app.name));
  
  app.on('window-all-closed', async () =&gt; {
    await clearBloat();
  });
  </code></pre>