Electron

Electron是將chromium和nodejs整合在一塊兒,經過這個工具能夠使用nodejs,html(5),css(3)建立跨平臺的桌面程序;css


用web的開發方式,並且能和原生操做系統交互,建立跨windows、mac、linux平臺的桌面程序,仍是頗有吸引力的;html


這種相似net的webbrowser,但webbrowser只支持ie內核更別說跨平臺了、html5等新的標準了~~~html5

 

安裝node

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

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

 

運行shell

electron .npm

 

打包windows

npm install -g asarapp

asar pack your-app app.asar

 

注意:包裏面最好不要亂放東西,就放html,js,css,圖片這些,而後把app.asar複製到atom-shell(或electron)目錄下的resources裏面,

而後直接雙擊electron.exe,你會發現打開的程序是你的,而不是本來默認的,還有這個asar的文件名必定是app;

相關文章
相關標籤/搜索