const{app,BrowserWindow}=require('electron')constpath=require('path')consturl=require('url')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.webContents.openDevTools()win.on('closed',()=>{win=null})}app.on('ready',createWindow)