搭建

package.json

{
"name": "electron-quick-start",
"version": "1.0.0",
"description": "A minimal Electron application",
"main": "main.js",
"build": {
"appId": "com.xxx.app",
"mac": {
"target": [
"dmg",
"zip"
]
},
"win": {
"target": [
"nsis",
"zip"
]
}
},
"scripts": {
"start": "electron .",
"dist": "electron-builder --mac --x64"
},
"repository": "https://github.com/electron/electron-quick-start",
"keywords": [
"Electron",
"quick",
"start",
"tutorial",
"demo"
],
"author": "GitHub",
"license": "CC0-1.0",
"devDependencies": {
"electron": "^8.2.1",
"electron-builder": "^22.4.1"
},
"dependencies": {
"sqlite3": "^4.1.1"
}
}

sqlite3

需要注意搭配 electron 的版本,但是感觉没什么卵关系。

electron-builder

打包桌面应用

body-parser

express 解析post请求json