node/doc/api
Joyee Cheung ac34e7561a
src: support snapshot in single executable applications
This patch adds snapshot support to single executable applications.
To build a snapshot from the main script when preparing the
blob that will be injected into the single executable application,
add `"useSnapshot": true` to the configuration passed to
`--experimental-sea-config`. For example:

```
{
    "main": "snapshot.js",
    "output": "sea-prep.blob",
    "useSnapshot": true
}
```

The main script used to build the snapshot must invoke
`v8.startupSnapshot.setDeserializeMainFunction()` to configure the
entry point. The generated startup snapshot would be part of the
preparation blob and get injected into the final executable.

When the single executable application is launched, instead of running
the `main` script from scratch, Node.js would instead deserialize the
snapshot to get to the state initialized during build-time directly.

PR-URL: https://github.com/nodejs/node/pull/46824
Refs: https://github.com/nodejs/single-executable/discussions/57
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-07-20 22:57:00 +00:00
..
addons.md doc: harmonize fenced code snippet flags 2023-05-21 09:36:57 +02:00
assert.md doc: fix params names 2023-05-06 19:41:58 +00:00
async_context.md 2023-04-18, Version 20.0.0 (Current) 2023-04-18 13:04:39 -03:00
async_hooks.md doc: declare path on example of async_hooks.executionAsyncId() 2023-07-18 20:00:50 +00:00
buffer.md doc: clarify array args to Buffer.from() 2023-06-02 21:44:47 +00:00
child_process.md 2023-07-18, Version 20.5.0 (Current) 2023-07-20 16:28:46 -05:00
cli.md 2023-07-18, Version 20.5.0 (Current) 2023-07-20 16:28:46 -05:00
cluster.md doc: improve the documentation of the stdio option 2023-05-30 06:10:58 +00:00
console.md doc: use serial comma in console docs 2022-05-31 14:57:50 +01:00
corepack.md doc: mention corepack prepare supports tag or range 2022-10-10 02:47:39 +02:00
crypto.md doc,test: clarify behavior of DH generateKeys 2023-06-20 17:30:34 -03:00
debugger.md debugger: improve validations and documents for watch and unwatch 2023-03-13 04:29:53 +00:00
deprecations.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
dgram.md 2023-07-18, Version 20.5.0 (Current) 2023-07-20 16:28:46 -05:00
diagnostics_channel.md doc: fix typos 2023-04-23 13:34:08 +00:00
dns.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
documentation.md doc: add experimental stages 2023-01-14 14:25:08 +00:00
domain.md doc: fix typos 2023-04-23 13:34:08 +00:00
embedding.md src: add detailed embedder process initialization API 2022-08-05 19:46:08 +00:00
errors.md esm: unflag Module.register and allow nested loader import() 2023-07-19 10:33:47 +00:00
esm.md module: implement register utility 2023-06-12 00:00:46 +00:00
events.md 2023-07-18, Version 20.5.0 (Current) 2023-07-20 16:28:46 -05:00
fs.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
globals.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
http2.md 2023-07-05, Version 20.4.0 (Current) 2023-07-05 10:51:42 -03:00
http.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
https.md doc: fix ambiguity in http.md and https.md 2023-07-12 16:25:27 +02:00
index.md src: add initial support for single executable applications 2023-02-18 02:49:18 +00:00
inspector.md inspector: open add SymbolDispose 2023-07-16 09:46:27 +00:00
intl.md doc: fix icu-small example 2022-06-30 09:34:10 -04:00
module.md module: add SourceMap.lineLengths 2023-07-12 18:37:32 +00:00
modules.md doc: use "file system" instead of "filesystem" 2023-01-14 01:10:38 +00:00
n-api.md doc: refactor node-api support matrix 2023-07-19 00:06:45 +00:00
net.md 2023-07-18, Version 20.5.0 (Current) 2023-07-20 16:28:46 -05:00
os.md doc: add a note about os.cpus() returning an empty list 2023-04-04 12:29:52 -07:00
packages.md doc: link to Runtime Keys in export conditions 2023-06-20 02:24:27 +00:00
path.md doc: add lint rule to enforce trailing commas 2022-11-17 13:19:12 +00:00
perf_hooks.md doc: indicate that name is no longer an optional argument 2023-03-17 12:48:53 +00:00
permissions.md src,permission: restrict inspector when pm enabled 2023-06-20 17:30:27 -03:00
policy.md doc: move policy docs to the permissions scope 2022-09-05 16:07:45 +00:00
process.md doc: harmonize fenced code snippet flags 2023-05-21 09:36:57 +02:00
punycode.md doc: format doc/api/*.md with markdown formatter 2021-10-20 11:59:11 +02:00
querystring.md doc: remove Legacy status from querystring 2022-10-09 15:22:50 +00:00
readline.md doc: fix typo in readline completer function section 2023-05-27 19:32:38 +00:00
repl.md doc: harmonize fenced code snippet flags 2023-05-21 09:36:57 +02:00
report.md doc: use "file system" instead of "filesystem" 2023-01-14 01:10:38 +00:00
single-executable-applications.md src: support snapshot in single executable applications 2023-07-20 22:57:00 +00:00
stream.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
string_decoder.md doc: add node: prefix for all core modules 2022-04-20 10:23:41 +02:00
synopsis.md doc: harmonize fenced code snippet flags 2023-05-21 09:36:57 +02:00
test.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
timers.md 2023-07-18, Version 20.5.0 (Current) 2023-07-20 16:28:46 -05:00
tls.md 2023-07-05, Version 20.4.0 (Current) 2023-07-05 10:51:42 -03:00
tracing.md src: trace threadpool event 2022-11-01 04:21:13 +00:00
tty.md doc: clarify tty.isRaw 2023-05-21 16:41:28 +00:00
url.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
util.md doc: unnest mime and MIMEParams from MIMEType constructor 2023-06-23 19:17:23 +00:00
v8.md doc,test: update the v8.startupSnapshot doc and test the example 2023-05-03 13:14:56 +00:00
vm.md doc,vm: clarify usage of cachedData in vm.compileFunction() 2023-05-29 01:26:22 +00:00
wasi.md doc: harmonize fenced code snippet flags 2023-05-21 09:36:57 +02:00
webcrypto.md 2023-07-18, Version 18.17.0 'Hydrogen' (LTS) 2023-07-18 15:37:22 -04:00
webstreams.md stream: implement ReadableStream.from 2023-07-18 09:50:22 +00:00
worker_threads.md src: throw DataCloneError on transfering untransferable objects 2023-05-05 11:22:42 +00:00
zlib.md doc: add lint rule to enforce trailing commas 2022-11-17 13:19:12 +00:00