const { app, BrowserWindow } = require('electron')
const path = require('path')
function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
win.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
# electron latest
npm i -D electron@latest
# electron beta
npm i -D electron@beta
# electron alpha
npm i -D electron@alpha
# electron nightly
npm i -D electron-nightly
git clone https://github.com/electron/electron-quick-start
cd electron-quick-start
npm install && npm start
$ npm i -D electron@latest
# Electron 10.1.3
# Node 12.16.3
# Chromium 85.0.4183.121
$ npm i -D electron@beta
# Electron 11.0.0-beta.9
# Node 12.18.3
# Chromium 87.0.4251.1
$ npm i -D electron@latest
# Electron 11.2.3
# Node 12.18.3
# Chromium 87.0.4280.141
$ npm i -D electron-nightly
# Electron 12.0.0-nightly.20200914
# Node 12.18.3
# Chromium 86.0.4234.0