const{app,BrowserWindow}=require('electron')constpath=require('path')consturl=require('url')// Keep a global reference of the window object, if you don't, the window will// be closed automatically when the JavaScript object is garbage collected.letwinfunctioncreateWindow(){// Create the browser window.win=newBrowserWindow({width:800,height:600})// and load the index.html of the app.win.loadURL(url.format({pathname:path.join(__dirname,'index.html'),protocol:'file:',slashes:true}))win.on('closed',()=>{win=null})}app.on('ready',createWindow)