title: How to keep running electron app in background when pc is kept sleep?
body: <p>I want to build an electron app which should be running in background even when pc is kept on sleep mode. I have used electron's <code>powerSaveBlocker</code> according to <a href="https://electronjs.org/docs/api/power-save-blocker" rel="nofollow noreferrer">this</a> doc and I added those lines in my <code>main.js</code> file like this: </p>
  
  <pre><code>...
  const {app, BrowserWindow, Tray, Menu, ipcMain} = require('electron');
  const path = require('path');
  const { powerSaveBlocker } = require('electron');
  
  const id = powerSaveBlocker.start('prevent-app-suspension');
  console.log(powerSaveBlocker.isStarted(id));
  
  let win;
  ...
  </code></pre>
  
  <p>But this isn't working for me. Is there any other way?</p>