/ app.js
app.js
 1  var electron = require("electron");
 2  var path = require("path");
 3  
 4  var win = null;
 5  var app = electron.app;
 6  var BrowserWindow = electron.BrowserWindow;
 7  
 8  app.on("ready", function () {
 9    console.log("The application is ready.");
10  
11    win = new BrowserWindow({
12      width: 500,
13      height: 397,
14      minWidth: 500,
15      minHeight: 397,
16      webPreferences: {
17        nodeIntegration: true,
18      },
19    });
20  
21    win.loadURL("file://" + path.join(__dirname, "index.html"));
22    win.on("close", function () {
23      win = null;
24    });
25  
26    // win.webContents.openDevTools()
27  });