##开发环境及版本号##
NodeJS : 7.2.0
Electron : 1.4.10
##开始教程##
安装各个应用:
安装electron的包
npm install -g electron
安装 aser 打包工具
npm install -g asar
安装 packager 发布工具
npm install -g electron-packager
建立空的 nodejs 项目:
npm init
建立js程序 index.js :
const {app, BrowserWindow} = require('electron')
const path = require('path')
const url = 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.
let win
function createWindow () {
// Create the browser window.
win = new BrowserWindow({width: 800, height: 600,autoHideMenuBar :true})
win.setMenu(null);
// and load the index.html