Node.js Compiler Code
Compiling your Node.js application into a single executable.
Brought to you by:
pmq20
File | Date | Author | Commit |
---|---|---|---|
bin | 2017-06-01 | Minqi Pan | [3bbaae] . |
lib | 2017-06-05 | Minqi Pan | [5dbd33] start working on v1.1.0 |
node | 2017-06-01 | Minqi Pan | [4cd78e] set Verbosity=quiet |
tests | 2017-06-05 | Minqi Pan | [a1e49e] release nodec v1.0.0 |
.gitignore | 2017-05-24 | Minqi Pan | [2a8b0a] import https://github.com/nodejs/node/commit/80... |
.gitmodules | 2017-06-02 | Minqi Pan | [42e536] change to tests/node-compiler-ci2 |
.travis.yml | 2017-06-01 | Minqi Pan | [0d93db] use node_js: 8.0.0 |
CHANGELOG.md | 2017-06-05 | Minqi Pan | [5dbd33] start working on v1.1.0 |
LICENSE | 2017-01-17 | Minqi Pan | [e4a68f] add MIT License |
README.md | 2017-06-09 | Minqi Pan | [52782d] Update README.md |
ROADMAP.md | 2017-06-07 | Minqi Pan | [00ee2d] Update ROADMAP.md |
appveyor.yml | 2017-06-02 | Minqi Pan | [0cbd1b] add node-compiler-appveyor2, test win-x64 |
nodec.gif | 2017-03-13 | Minqi Pan | [eee88a] add nodec.gif |
Ahead-of-time (AOT) Compiler designed for Node.js.
Master CI | Master CI Part 2 | RAM CI | Black‑box CI | |
---|---|---|---|---|
Windows | ||||
Linux / macOS | N/A |
Arch. | Latest Stable | |
---|---|---|
Windows | x86-64 | https://sourceforge.net/projects/node-compiler/files/v1.0.0/nodec-x64.exe/download |
macOS | x86-64 | https://sourceforge.net/projects/node-compiler/files/v1.0.0/nodec-darwin-x64/download |
Linux | x86-64 | https://sourceforge.net/projects/node-compiler/files/v1.0.0/nodec-linux-x64/download |
Project | Differences |
---|---|
pkg | Pkg hacked fs.* API's dynamically in order to access in-package files, whereas Node.js Compiler leaves them alone and instead works on a deeper level via libsquash. Pkg uses JSON to store in-package files while Node.js Compiler uses the more sophisticated and widely used SquashFS as its data structure. |
EncloseJS | EncloseJS restricts access to in-package files to only five fs.* API's, whereas Node.js Compiler supports all fs.* API's. EncloseJS is proprietary licensed and charges money when used while Node.js Compiler is MIT-licensed and users are both free to use it and free to modify it. |
Nexe | Nexe does not support dynamic require because of its use of browserify , whereas Node.js Compiler supports all kinds of require including require.resolve . |
asar | Asar keeps the code archive and the executable separate while Node.js Compiler links all JavaScript source code together with the Node.js virtual machine and generates a single executable as the final product. Asar uses JSON to store files' information while Node.js Compiler uses SquashFS. |
AppImage | AppImage supports only Linux with a kernel that supports SquashFS, while Node.js Compiler supports all three platforms of Linux, macOS and Windows, meanwhile without any special feature requirements from the kernel. |
First install the prerequisites:
Then download the executable nodec-x64.exe and run it from the VC++ or VS Command Prompt.
First install the prerequisites:
brew install squashfs
Command Line Tools
via Xcode. You can findXcode -> Preferences -> Downloads
gcc
and the related toolchain containing make
Then,
curl -L https://sourceforge.net/projects/node-compiler/files/v1.0.0/nodec-darwin-x64/download > nodec
chmod +x nodec
./nodec
First install the prerequisites:
gcc
and g++
4.8.2 or newer, orclang
and clang++
3.4 or newerThen,
curl -L https://sourceforge.net/projects/node-compiler/files/v1.0.0/nodec-linux-x64/download > nodec
chmod +x nodec
./nodec
nodec [OPTION]... ENTRANCE
-r, --root=DIR Specifies the path to the root of the application
-o, --output=FILE Specifies the path of the output file
-d, --tmpdir=DIR Specifies the directory for temporary files
--clean-tmpdir Cleans all temporary files that were generated last time
--keep-tmpdir Keeps all temporary files that were generated last time
--make-args=ARGS Passes extra arguments to make
--vcbuild-args=ARGS Passes extra arguments to vcbuild.bat
-n, --npm=FILE Specifies the path of npm
--npm-package=NAME Downloads and compiles the specified npm package
--npm-package-version=VER Downloads and compiles the specified version of the npm package
--auto-update-url=URL Enables auto-update and specifies the URL to get the latest version
--auto-update-base=STRING Enables auto-update and specifies the base version string
--debug Enable debug mode
-v, --version Prints the version of nodec and exit
--node-version Prints the version of the Node.js runtime and exit
-h, --help Prints this help and exit
--examples Prints usage examples
git clone --depth 1 https://github.com/jashkenas/coffeescript.git
cd coffeescript
nodec bin/coffee
./a.out (or a.exe on Windows)
git clone --depth 1 https://github.com/eggjs/examples.git
cd examples/helloworld
npm install
nodec node_modules/.bin/egg-bin
./a.out dev (or a.exe dev on Windows)