title: NW.js How to debug when your main file is an JS file?
body: <p>package.json:</p>
  
  <pre><code>{
      "name": "Test App",
      "main": "driver.js"
  }
  </code></pre>
  
  <p>How to invoke the devtools?</p>
  
  <p>I have tried:</p>
  
  <pre><code>const gui = require('nw.gui');
  var win = gui.Window.get();
  win.showDevTools();
  </code></pre>
  
  <p>But nothing happens...<br>
  Because there's no window?<br>
  If i use Window.open then hit F12 it shows the devtools of the new window but no logs from the code running at the main file
  (even with mixed context)</p>
  
  <p>The code surely is running, i made it deposit a file on the system using fs.writeFileSync with success.<br>
  But at the first problem i get clueless, because no output...</p>