How to prevent multiple instances in Electron

There is a new API now: requestSingleInstanceLock const { app } = require(‘electron’) let myWindow = null const gotTheLock = app.requestSingleInstanceLock() if (!gotTheLock) { app.quit() } else { app.on(‘second-instance’, (event, commandLine, workingDirectory) => { // Someone tried to run a second instance, we should focus our window. if (myWindow) { if (myWindow.isMinimized()) myWindow.restore() myWindow.focus() } … Read more

How to persist data in an Electron app? [closed]

NeDB is the only suggested or featured tool as an embedded persistent database for Electron by Electron, currently. – http://electron.atom.io/community/ It’s also could be useful to store user settings if settings are complex. Why NeDB could be a better solution on this case? Embedded persistent or in memory database for Node.js, nw.js, Electron and browsers, … Read more

Using console.log() in Electron app

console.log works, but where it logs to depends on whether you call it from the main process or the renderer process. If you call it from the renderer process (i.e. JavaScript that is included from your index.html file) it will be logged to the dev tools window. If you call it from the main process … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)