Electron how to save file to desktop

var fs = require('fs');
try { 
  fs.writeFileSync(app.getPath('desktop')+'/thefile.txt', content, 'utf-8'); 
}
catch(e) { alert('Failed to save the file !'); }

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top