electron + typescript + electron-builder
$>npm install
or
$>yarn install
$>npm start
or
$>yarn start
$>npm run build:win32
or
$>yarn run build:win32
- create file ".gitignore" > "node_modules/"
- create file "package.jgon" >
{
"name": "your-app",
"version": "0.1.0",
"main": "main.js",
"scripts": {
"start": "electron ."
}
}
- $>npm install --save-electron
- create file "main.js" >
const { app, BrowserWindow } = require('electron')
function createWindow () {
// Create the browser window.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
win.loadFile('index.html')
}
app.on('ready', createWindow)
- create file "index.html"
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<!-- https://electronjs.org/docs/tutorial/security#csp-meta-tag -->
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
</head>
<body>
<h1>Hello World!</h1>
We are using node <script>document.write(process.versions.node)</script>,
Chrome <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
</body>
</html>
- custom-electron-titlebar : vscode와 비슷한 타이틀 메뉴바
- electron-json-storage: json로컬 저장
- NeDB: DB
- chrome-tabs: 크롬 탭 모양
- 참고. Electron-commnunity
- node-hid: USB connector
- serialport
- electron-store