为NodeJS应用创建单一可执行文件的工具:Nexe

jopen 9年前

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.open-open.com/lib/view/home/1414308561262