Electron

Electron是将chromium和nodejs整合在一起,通过这个工具可以使用nodejs,html(5),css(3)创建跨平台的桌面程序;


用web的开发方式,而且能和原生操作系统交互,创建跨windows、mac、linux平台的桌面程序,还是很有吸引力的;


这种类似net的webbrowser,但webbrowser只支持ie内核更别说跨平台了、html5等新的标准了~~~

安装

# Install the `electron` command globally
npm install electron-prebuilt -g

# Install as a development dependency
npm install electron-prebuilt --save-dev

运行

electron .

打包

npm install -g asar

asar pack your-app app.asar

注意:包里面最好不要乱放东西,就放html,js,css,图片这些,然后把app.asar复制到atom-shell(或electron)目录下的resources里面,

然后直接双击electron.exe,你会发现打开的程序是你的,而不是原本默认的,还有这个asar的文件名一定是app;

原文地址:https://www.cnblogs.com/sl21100/p/5038445.html