為NodeJS應用創建單一可執行文件的工具:Nexe

jopen 10年前發布 | 59K 次閱讀 Nexe Node.js 開發

Nexe 是一款小巧卻非常實用的,它可以為NodeJS應用創建單一可執行的文件,并且無需安裝運行時,這樣,一些非技術終端的用戶就無需變動 NodeJS應用的所有依賴程序。如果你想發布一個NodeJS應用程序,并且沒有GUI,Nexe則是您的最佳選擇。目前該應用程序的一個弊端是不能在 Windows平臺上工作,只適用于Linux和Mac OS X平臺,并且它也不支持本地NodeJS模塊。

Usage: nexe -i [sources] -o [binary]

Options:
  -i, --input    The entry javascript files         [default: cwd]
  -o, --output   The output binary                  [default: cwd/release/app.nex]
  -r, --runtime  The node.js runtime to use         [default: "0.8.15"]
  -t, --temp     The path to store node.js sources  [default: /tmp/nexe]
  -f, --flags    Don't parse node and v8 flags, pass through app flags  [default: false]

var nexe = require('nexe');

nexe.compile({
    input: 'input.js',
    output: 'path/to/bin',
    nodeVersion: '0.8.15',
    nodeTempDir: __dirname
    flags: true
}, function(err) {

});

為NodeJS應用創建單一可執行文件的工具:Nexe

項目主頁:http://www.baiduhome.net/lib/view/home/1414308561262

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!