Not a pain at all, but in Electron, we might want some method to close entirely our software.
We know that we can access our electron’s app via the renderer by calling the object remote. So this is the solution
const app = require('electron').remote.app
If it helped, or if you have better, let us know !