Node.js Single Executable Applications
https://github.com/nodejs/node/releases/tag/v18.16.0
Node.js 当前(
)最新长期支持版本 18.16.0 为 SEA(Single Executable Applications)提供了初步支持。 1$ echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js
2
3$ cp $(command -v node) hello
4
5# On systems other than macOS:
6$ npx postject hello NODE_JS_CODE hello.js \
7 --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2
8
9# On macOS:
10$ npx postject hello NODE_JS_CODE hello.js \
11 --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
12 --macho-segment-name NODE_JS
13
14$ ./hello world
15Hello, world!