mirror of
https://github.com/nodejs/node.git
synced 2026-12-04 02:19:15 -05:00
Compile a JavaScript file into a single executable application:
```console
$ echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js
$ cp $(command -v node) hello
$ npx postject hello NODE_JS_CODE hello.js \
--sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2
$ npx postject hello NODE_JS_CODE hello.js \
--sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
--macho-segment-name NODE_JS
$ ./hello world
Hello, world!
```
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45038
Backport-PR-URL: https://github.com/nodejs/node/pull/47495
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
24 lines
496 B
C++
24 lines
496 B
C++
#ifndef SRC_NODE_SEA_H_
|
|
#define SRC_NODE_SEA_H_
|
|
|
|
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION)
|
|
|
|
#include <tuple>
|
|
|
|
namespace node {
|
|
namespace sea {
|
|
|
|
bool IsSingleExecutable();
|
|
std::tuple<int, char**> FixupArgsForSEA(int argc, char** argv);
|
|
|
|
} // namespace sea
|
|
} // namespace node
|
|
|
|
#endif // !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION)
|
|
|
|
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
|
|
#endif // SRC_NODE_SEA_H_
|