Last active
February 21, 2024 20:09
-
-
Save EntityPlantt/ca6ac79e789750383fde1b03199eaea0 to your computer and use it in GitHub Desktop.
Creates a single executable application from a single JS file; see https://nodejs.org/api/single-executable-applications.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(`Hello! Running Node!!`); | |
for (var i of [1, 2, 3, 4, 5, 6]) { | |
console.log("this is an experimental feature"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node --experimental-sea-config sea-config.json | |
cp $(command -v node) output | |
pnpx postject output NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"main": "node-sea.js", | |
"output": "sea-prep.blob" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run:
bash build.sh
,sh build.sh
,./build.sh
or any other way (just run the script)Creates file tree:
output
(executable)sea-prep.blob
(blob with script data)Requires Node v18.6.0 or later