11cb0ef41Sopenharmony_ci# Command-line API
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ci<!--introduced_in=v5.9.1-->
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci<!--type=misc-->
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciNode.js comes with a variety of CLI options. These options expose built-in
81cb0ef41Sopenharmony_cidebugging, multiple ways to execute scripts, and other helpful runtime options.
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciTo view this documentation as a manual page in a terminal, run `man node`.
111cb0ef41Sopenharmony_ci
121cb0ef41Sopenharmony_ci## Synopsis
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ci`node [options] [V8 options] [<program-entry-point> | -e "script" | -] [--] [arguments]`
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_ci`node inspect [<program-entry-point> | -e "script" | <host>:<port>] …`
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_ci`node --v8-options`
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ciExecute without arguments to start the [REPL][].
211cb0ef41Sopenharmony_ci
221cb0ef41Sopenharmony_ciFor more info about `node inspect`, see the [debugger][] documentation.
231cb0ef41Sopenharmony_ci
241cb0ef41Sopenharmony_ci## Program entry point
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_ciThe program entry point is a specifier-like string. If the string is not an
271cb0ef41Sopenharmony_ciabsolute path, it's resolved as a relative path from the current working
281cb0ef41Sopenharmony_cidirectory. That path is then resolved by [CommonJS][] module loader, or by the
291cb0ef41Sopenharmony_ci[ES module loader][Modules loaders] if [`--experimental-default-type=module`][]
301cb0ef41Sopenharmony_ciis passed. If no corresponding file is found, an error is thrown.
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ciIf a file is found, its path will be passed to the
331cb0ef41Sopenharmony_ci[ES module loader][Modules loaders] under any of the following conditions:
341cb0ef41Sopenharmony_ci
351cb0ef41Sopenharmony_ci* The program was started with a command-line flag that forces the entry
361cb0ef41Sopenharmony_ci  point to be loaded with ECMAScript module loader, such as `--import` or
371cb0ef41Sopenharmony_ci  [`--experimental-default-type=module`][].
381cb0ef41Sopenharmony_ci* The file has an `.mjs` extension.
391cb0ef41Sopenharmony_ci* The file does not have a `.cjs` extension, and the nearest parent
401cb0ef41Sopenharmony_ci  `package.json` file contains a top-level [`"type"`][] field with a value of
411cb0ef41Sopenharmony_ci  `"module"`.
421cb0ef41Sopenharmony_ci
431cb0ef41Sopenharmony_ciOtherwise, the file is loaded using the CommonJS module loader. See
441cb0ef41Sopenharmony_ci[Modules loaders][] for more details.
451cb0ef41Sopenharmony_ci
461cb0ef41Sopenharmony_ci### ECMAScript modules loader entry point caveat
471cb0ef41Sopenharmony_ci
481cb0ef41Sopenharmony_ciWhen loading, the [ES module loader][Modules loaders] loads the program
491cb0ef41Sopenharmony_cientry point, the `node` command will accept as input only files with `.js`,
501cb0ef41Sopenharmony_ci`.mjs`, or `.cjs` extensions; with `.wasm` extensions when
511cb0ef41Sopenharmony_ci[`--experimental-wasm-modules`][] is enabled; and with no extension when
521cb0ef41Sopenharmony_ci[`--experimental-default-type=module`][] is passed.
531cb0ef41Sopenharmony_ci
541cb0ef41Sopenharmony_ci## Options
551cb0ef41Sopenharmony_ci
561cb0ef41Sopenharmony_ci<!-- YAML
571cb0ef41Sopenharmony_cichanges:
581cb0ef41Sopenharmony_ci  - version: v10.12.0
591cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/23020
601cb0ef41Sopenharmony_ci    description: Underscores instead of dashes are now allowed for
611cb0ef41Sopenharmony_ci                 Node.js options as well, in addition to V8 options.
621cb0ef41Sopenharmony_ci-->
631cb0ef41Sopenharmony_ci
641cb0ef41Sopenharmony_ciAll options, including V8 options, allow words to be separated by both
651cb0ef41Sopenharmony_cidashes (`-`) or underscores (`_`). For example, `--pending-deprecation` is
661cb0ef41Sopenharmony_ciequivalent to `--pending_deprecation`.
671cb0ef41Sopenharmony_ci
681cb0ef41Sopenharmony_ciIf an option that takes a single value (such as `--max-http-header-size`) is
691cb0ef41Sopenharmony_cipassed more than once, then the last passed value is used. Options from the
701cb0ef41Sopenharmony_cicommand line take precedence over options passed through the [`NODE_OPTIONS`][]
711cb0ef41Sopenharmony_cienvironment variable.
721cb0ef41Sopenharmony_ci
731cb0ef41Sopenharmony_ci### `-`
741cb0ef41Sopenharmony_ci
751cb0ef41Sopenharmony_ci<!-- YAML
761cb0ef41Sopenharmony_ciadded: v8.0.0
771cb0ef41Sopenharmony_ci-->
781cb0ef41Sopenharmony_ci
791cb0ef41Sopenharmony_ciAlias for stdin. Analogous to the use of `-` in other command-line utilities,
801cb0ef41Sopenharmony_cimeaning that the script is read from stdin, and the rest of the options
811cb0ef41Sopenharmony_ciare passed to that script.
821cb0ef41Sopenharmony_ci
831cb0ef41Sopenharmony_ci### `--`
841cb0ef41Sopenharmony_ci
851cb0ef41Sopenharmony_ci<!-- YAML
861cb0ef41Sopenharmony_ciadded: v6.11.0
871cb0ef41Sopenharmony_ci-->
881cb0ef41Sopenharmony_ci
891cb0ef41Sopenharmony_ciIndicate the end of node options. Pass the rest of the arguments to the script.
901cb0ef41Sopenharmony_ciIf no script filename or eval/print script is supplied prior to this, then
911cb0ef41Sopenharmony_cithe next argument is used as a script filename.
921cb0ef41Sopenharmony_ci
931cb0ef41Sopenharmony_ci### `--abort-on-uncaught-exception`
941cb0ef41Sopenharmony_ci
951cb0ef41Sopenharmony_ci<!-- YAML
961cb0ef41Sopenharmony_ciadded: v0.10.8
971cb0ef41Sopenharmony_ci-->
981cb0ef41Sopenharmony_ci
991cb0ef41Sopenharmony_ciAborting instead of exiting causes a core file to be generated for post-mortem
1001cb0ef41Sopenharmony_cianalysis using a debugger (such as `lldb`, `gdb`, and `mdb`).
1011cb0ef41Sopenharmony_ci
1021cb0ef41Sopenharmony_ciIf this flag is passed, the behavior can still be set to not abort through
1031cb0ef41Sopenharmony_ci[`process.setUncaughtExceptionCaptureCallback()`][] (and through usage of the
1041cb0ef41Sopenharmony_ci`node:domain` module that uses it).
1051cb0ef41Sopenharmony_ci
1061cb0ef41Sopenharmony_ci### `--build-snapshot`
1071cb0ef41Sopenharmony_ci
1081cb0ef41Sopenharmony_ci<!-- YAML
1091cb0ef41Sopenharmony_ciadded: v18.8.0
1101cb0ef41Sopenharmony_ci-->
1111cb0ef41Sopenharmony_ci
1121cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
1131cb0ef41Sopenharmony_ci
1141cb0ef41Sopenharmony_ciGenerates a snapshot blob when the process exits and writes it to
1151cb0ef41Sopenharmony_cidisk, which can be loaded later with `--snapshot-blob`.
1161cb0ef41Sopenharmony_ci
1171cb0ef41Sopenharmony_ciWhen building the snapshot, if `--snapshot-blob` is not specified,
1181cb0ef41Sopenharmony_cithe generated blob will be written, by default, to `snapshot.blob`
1191cb0ef41Sopenharmony_ciin the current working directory. Otherwise it will be written to
1201cb0ef41Sopenharmony_cithe path specified by `--snapshot-blob`.
1211cb0ef41Sopenharmony_ci
1221cb0ef41Sopenharmony_ci```console
1231cb0ef41Sopenharmony_ci$ echo "globalThis.foo = 'I am from the snapshot'" > snapshot.js
1241cb0ef41Sopenharmony_ci
1251cb0ef41Sopenharmony_ci# Run snapshot.js to initialize the application and snapshot the
1261cb0ef41Sopenharmony_ci# state of it into snapshot.blob.
1271cb0ef41Sopenharmony_ci$ node --snapshot-blob snapshot.blob --build-snapshot snapshot.js
1281cb0ef41Sopenharmony_ci
1291cb0ef41Sopenharmony_ci$ echo "console.log(globalThis.foo)" > index.js
1301cb0ef41Sopenharmony_ci
1311cb0ef41Sopenharmony_ci# Load the generated snapshot and start the application from index.js.
1321cb0ef41Sopenharmony_ci$ node --snapshot-blob snapshot.blob index.js
1331cb0ef41Sopenharmony_ciI am from the snapshot
1341cb0ef41Sopenharmony_ci```
1351cb0ef41Sopenharmony_ci
1361cb0ef41Sopenharmony_ciThe [`v8.startupSnapshot` API][] can be used to specify an entry point at
1371cb0ef41Sopenharmony_cisnapshot building time, thus avoiding the need of an additional entry
1381cb0ef41Sopenharmony_ciscript at deserialization time:
1391cb0ef41Sopenharmony_ci
1401cb0ef41Sopenharmony_ci```console
1411cb0ef41Sopenharmony_ci$ echo "require('v8').startupSnapshot.setDeserializeMainFunction(() => console.log('I am from the snapshot'))" > snapshot.js
1421cb0ef41Sopenharmony_ci$ node --snapshot-blob snapshot.blob --build-snapshot snapshot.js
1431cb0ef41Sopenharmony_ci$ node --snapshot-blob snapshot.blob
1441cb0ef41Sopenharmony_ciI am from the snapshot
1451cb0ef41Sopenharmony_ci```
1461cb0ef41Sopenharmony_ci
1471cb0ef41Sopenharmony_ciFor more information, check out the [`v8.startupSnapshot` API][] documentation.
1481cb0ef41Sopenharmony_ci
1491cb0ef41Sopenharmony_ciCurrently the support for run-time snapshot is experimental in that:
1501cb0ef41Sopenharmony_ci
1511cb0ef41Sopenharmony_ci1. User-land modules are not yet supported in the snapshot, so only
1521cb0ef41Sopenharmony_ci   one single file can be snapshotted. Users can bundle their applications
1531cb0ef41Sopenharmony_ci   into a single script with their bundler of choice before building
1541cb0ef41Sopenharmony_ci   a snapshot, however.
1551cb0ef41Sopenharmony_ci2. Only a subset of the built-in modules work in the snapshot, though the
1561cb0ef41Sopenharmony_ci   Node.js core test suite checks that a few fairly complex applications
1571cb0ef41Sopenharmony_ci   can be snapshotted. Support for more modules are being added. If any
1581cb0ef41Sopenharmony_ci   crashes or buggy behaviors occur when building a snapshot, please file
1591cb0ef41Sopenharmony_ci   a report in the [Node.js issue tracker][] and link to it in the
1601cb0ef41Sopenharmony_ci   [tracking issue for user-land snapshots][].
1611cb0ef41Sopenharmony_ci
1621cb0ef41Sopenharmony_ci### `--completion-bash`
1631cb0ef41Sopenharmony_ci
1641cb0ef41Sopenharmony_ci<!-- YAML
1651cb0ef41Sopenharmony_ciadded: v10.12.0
1661cb0ef41Sopenharmony_ci-->
1671cb0ef41Sopenharmony_ci
1681cb0ef41Sopenharmony_ciPrint source-able bash completion script for Node.js.
1691cb0ef41Sopenharmony_ci
1701cb0ef41Sopenharmony_ci```console
1711cb0ef41Sopenharmony_ci$ node --completion-bash > node_bash_completion
1721cb0ef41Sopenharmony_ci$ source node_bash_completion
1731cb0ef41Sopenharmony_ci```
1741cb0ef41Sopenharmony_ci
1751cb0ef41Sopenharmony_ci### `-C condition`, `--conditions=condition`
1761cb0ef41Sopenharmony_ci
1771cb0ef41Sopenharmony_ci<!-- YAML
1781cb0ef41Sopenharmony_ciadded:
1791cb0ef41Sopenharmony_ci  - v14.9.0
1801cb0ef41Sopenharmony_ci  - v12.19.0
1811cb0ef41Sopenharmony_ci-->
1821cb0ef41Sopenharmony_ci
1831cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
1841cb0ef41Sopenharmony_ci
1851cb0ef41Sopenharmony_ciEnable experimental support for custom [conditional exports][] resolution
1861cb0ef41Sopenharmony_ciconditions.
1871cb0ef41Sopenharmony_ci
1881cb0ef41Sopenharmony_ciAny number of custom string condition names are permitted.
1891cb0ef41Sopenharmony_ci
1901cb0ef41Sopenharmony_ciThe default Node.js conditions of `"node"`, `"default"`, `"import"`, and
1911cb0ef41Sopenharmony_ci`"require"` will always apply as defined.
1921cb0ef41Sopenharmony_ci
1931cb0ef41Sopenharmony_ciFor example, to run a module with "development" resolutions:
1941cb0ef41Sopenharmony_ci
1951cb0ef41Sopenharmony_ci```console
1961cb0ef41Sopenharmony_ci$ node -C development app.js
1971cb0ef41Sopenharmony_ci```
1981cb0ef41Sopenharmony_ci
1991cb0ef41Sopenharmony_ci### `--cpu-prof`
2001cb0ef41Sopenharmony_ci
2011cb0ef41Sopenharmony_ci<!-- YAML
2021cb0ef41Sopenharmony_ciadded: v12.0.0
2031cb0ef41Sopenharmony_ci-->
2041cb0ef41Sopenharmony_ci
2051cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
2061cb0ef41Sopenharmony_ci
2071cb0ef41Sopenharmony_ciStarts the V8 CPU profiler on start up, and writes the CPU profile to disk
2081cb0ef41Sopenharmony_cibefore exit.
2091cb0ef41Sopenharmony_ci
2101cb0ef41Sopenharmony_ciIf `--cpu-prof-dir` is not specified, the generated profile is placed
2111cb0ef41Sopenharmony_ciin the current working directory.
2121cb0ef41Sopenharmony_ci
2131cb0ef41Sopenharmony_ciIf `--cpu-prof-name` is not specified, the generated profile is
2141cb0ef41Sopenharmony_cinamed `CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile`.
2151cb0ef41Sopenharmony_ci
2161cb0ef41Sopenharmony_ci```console
2171cb0ef41Sopenharmony_ci$ node --cpu-prof index.js
2181cb0ef41Sopenharmony_ci$ ls *.cpuprofile
2191cb0ef41Sopenharmony_ciCPU.20190409.202950.15293.0.0.cpuprofile
2201cb0ef41Sopenharmony_ci```
2211cb0ef41Sopenharmony_ci
2221cb0ef41Sopenharmony_ci### `--cpu-prof-dir`
2231cb0ef41Sopenharmony_ci
2241cb0ef41Sopenharmony_ci<!-- YAML
2251cb0ef41Sopenharmony_ciadded: v12.0.0
2261cb0ef41Sopenharmony_ci-->
2271cb0ef41Sopenharmony_ci
2281cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
2291cb0ef41Sopenharmony_ci
2301cb0ef41Sopenharmony_ciSpecify the directory where the CPU profiles generated by `--cpu-prof` will
2311cb0ef41Sopenharmony_cibe placed.
2321cb0ef41Sopenharmony_ci
2331cb0ef41Sopenharmony_ciThe default value is controlled by the
2341cb0ef41Sopenharmony_ci[`--diagnostic-dir`][] command-line option.
2351cb0ef41Sopenharmony_ci
2361cb0ef41Sopenharmony_ci### `--cpu-prof-interval`
2371cb0ef41Sopenharmony_ci
2381cb0ef41Sopenharmony_ci<!-- YAML
2391cb0ef41Sopenharmony_ciadded: v12.2.0
2401cb0ef41Sopenharmony_ci-->
2411cb0ef41Sopenharmony_ci
2421cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
2431cb0ef41Sopenharmony_ci
2441cb0ef41Sopenharmony_ciSpecify the sampling interval in microseconds for the CPU profiles generated
2451cb0ef41Sopenharmony_ciby `--cpu-prof`. The default is 1000 microseconds.
2461cb0ef41Sopenharmony_ci
2471cb0ef41Sopenharmony_ci### `--cpu-prof-name`
2481cb0ef41Sopenharmony_ci
2491cb0ef41Sopenharmony_ci<!-- YAML
2501cb0ef41Sopenharmony_ciadded: v12.0.0
2511cb0ef41Sopenharmony_ci-->
2521cb0ef41Sopenharmony_ci
2531cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
2541cb0ef41Sopenharmony_ci
2551cb0ef41Sopenharmony_ciSpecify the file name of the CPU profile generated by `--cpu-prof`.
2561cb0ef41Sopenharmony_ci
2571cb0ef41Sopenharmony_ci### `--diagnostic-dir=directory`
2581cb0ef41Sopenharmony_ci
2591cb0ef41Sopenharmony_ciSet the directory to which all diagnostic output files are written.
2601cb0ef41Sopenharmony_ciDefaults to current working directory.
2611cb0ef41Sopenharmony_ci
2621cb0ef41Sopenharmony_ciAffects the default output directory of:
2631cb0ef41Sopenharmony_ci
2641cb0ef41Sopenharmony_ci* [`--cpu-prof-dir`][]
2651cb0ef41Sopenharmony_ci* [`--heap-prof-dir`][]
2661cb0ef41Sopenharmony_ci* [`--redirect-warnings`][]
2671cb0ef41Sopenharmony_ci
2681cb0ef41Sopenharmony_ci### `--disable-proto=mode`
2691cb0ef41Sopenharmony_ci
2701cb0ef41Sopenharmony_ci<!-- YAML
2711cb0ef41Sopenharmony_ciadded:
2721cb0ef41Sopenharmony_ci - v13.12.0
2731cb0ef41Sopenharmony_ci - v12.17.0
2741cb0ef41Sopenharmony_ci-->
2751cb0ef41Sopenharmony_ci
2761cb0ef41Sopenharmony_ciDisable the `Object.prototype.__proto__` property. If `mode` is `delete`, the
2771cb0ef41Sopenharmony_ciproperty is removed entirely. If `mode` is `throw`, accesses to the
2781cb0ef41Sopenharmony_ciproperty throw an exception with the code `ERR_PROTO_ACCESS`.
2791cb0ef41Sopenharmony_ci
2801cb0ef41Sopenharmony_ci### `--disallow-code-generation-from-strings`
2811cb0ef41Sopenharmony_ci
2821cb0ef41Sopenharmony_ci<!-- YAML
2831cb0ef41Sopenharmony_ciadded: v9.8.0
2841cb0ef41Sopenharmony_ci-->
2851cb0ef41Sopenharmony_ci
2861cb0ef41Sopenharmony_ciMake built-in language features like `eval` and `new Function` that generate
2871cb0ef41Sopenharmony_cicode from strings throw an exception instead. This does not affect the Node.js
2881cb0ef41Sopenharmony_ci`node:vm` module.
2891cb0ef41Sopenharmony_ci
2901cb0ef41Sopenharmony_ci### `--dns-result-order=order`
2911cb0ef41Sopenharmony_ci
2921cb0ef41Sopenharmony_ci<!-- YAML
2931cb0ef41Sopenharmony_ciadded:
2941cb0ef41Sopenharmony_ci  - v16.4.0
2951cb0ef41Sopenharmony_ci  - v14.18.0
2961cb0ef41Sopenharmony_cichanges:
2971cb0ef41Sopenharmony_ci  - version: v17.0.0
2981cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/39987
2991cb0ef41Sopenharmony_ci    description: Changed default value to `verbatim`.
3001cb0ef41Sopenharmony_ci-->
3011cb0ef41Sopenharmony_ci
3021cb0ef41Sopenharmony_ciSet the default value of `verbatim` in [`dns.lookup()`][] and
3031cb0ef41Sopenharmony_ci[`dnsPromises.lookup()`][]. The value could be:
3041cb0ef41Sopenharmony_ci
3051cb0ef41Sopenharmony_ci* `ipv4first`: sets default `verbatim` `false`.
3061cb0ef41Sopenharmony_ci* `verbatim`: sets default `verbatim` `true`.
3071cb0ef41Sopenharmony_ci
3081cb0ef41Sopenharmony_ciThe default is `verbatim` and [`dns.setDefaultResultOrder()`][] have higher
3091cb0ef41Sopenharmony_cipriority than `--dns-result-order`.
3101cb0ef41Sopenharmony_ci
3111cb0ef41Sopenharmony_ci### `--enable-fips`
3121cb0ef41Sopenharmony_ci
3131cb0ef41Sopenharmony_ci<!-- YAML
3141cb0ef41Sopenharmony_ciadded: v6.0.0
3151cb0ef41Sopenharmony_ci-->
3161cb0ef41Sopenharmony_ci
3171cb0ef41Sopenharmony_ciEnable FIPS-compliant crypto at startup. (Requires Node.js to be built
3181cb0ef41Sopenharmony_ciagainst FIPS-compatible OpenSSL.)
3191cb0ef41Sopenharmony_ci
3201cb0ef41Sopenharmony_ci### `--enable-network-family-autoselection`
3211cb0ef41Sopenharmony_ci
3221cb0ef41Sopenharmony_ci<!-- YAML
3231cb0ef41Sopenharmony_ciadded: v18.18.0
3241cb0ef41Sopenharmony_ci-->
3251cb0ef41Sopenharmony_ci
3261cb0ef41Sopenharmony_ciEnables the family autoselection algorithm unless connection options explicitly
3271cb0ef41Sopenharmony_cidisables it.
3281cb0ef41Sopenharmony_ci
3291cb0ef41Sopenharmony_ci### `--enable-source-maps`
3301cb0ef41Sopenharmony_ci
3311cb0ef41Sopenharmony_ci<!-- YAML
3321cb0ef41Sopenharmony_ciadded: v12.12.0
3331cb0ef41Sopenharmony_cichanges:
3341cb0ef41Sopenharmony_ci  - version:
3351cb0ef41Sopenharmony_ci      - v15.11.0
3361cb0ef41Sopenharmony_ci      - v14.18.0
3371cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/37362
3381cb0ef41Sopenharmony_ci    description: This API is no longer experimental.
3391cb0ef41Sopenharmony_ci-->
3401cb0ef41Sopenharmony_ci
3411cb0ef41Sopenharmony_ciEnable [Source Map v3][Source Map] support for stack traces.
3421cb0ef41Sopenharmony_ci
3431cb0ef41Sopenharmony_ciWhen using a transpiler, such as TypeScript, stack traces thrown by an
3441cb0ef41Sopenharmony_ciapplication reference the transpiled code, not the original source position.
3451cb0ef41Sopenharmony_ci`--enable-source-maps` enables caching of Source Maps and makes a best
3461cb0ef41Sopenharmony_cieffort to report stack traces relative to the original source file.
3471cb0ef41Sopenharmony_ci
3481cb0ef41Sopenharmony_ciOverriding `Error.prepareStackTrace` prevents `--enable-source-maps` from
3491cb0ef41Sopenharmony_cimodifying the stack trace.
3501cb0ef41Sopenharmony_ci
3511cb0ef41Sopenharmony_ciNote, enabling source maps can introduce latency to your application
3521cb0ef41Sopenharmony_ciwhen `Error.stack` is accessed. If you access `Error.stack` frequently
3531cb0ef41Sopenharmony_ciin your application, take into account the performance implications
3541cb0ef41Sopenharmony_ciof `--enable-source-maps`.
3551cb0ef41Sopenharmony_ci
3561cb0ef41Sopenharmony_ci### `--experimental-global-customevent`
3571cb0ef41Sopenharmony_ci
3581cb0ef41Sopenharmony_ci<!-- YAML
3591cb0ef41Sopenharmony_ciadded: v18.7.0
3601cb0ef41Sopenharmony_ci-->
3611cb0ef41Sopenharmony_ci
3621cb0ef41Sopenharmony_ciExpose the [CustomEvent Web API][] on the global scope.
3631cb0ef41Sopenharmony_ci
3641cb0ef41Sopenharmony_ci### `--experimental-global-webcrypto`
3651cb0ef41Sopenharmony_ci
3661cb0ef41Sopenharmony_ci<!-- YAML
3671cb0ef41Sopenharmony_ciadded: v17.6.0
3681cb0ef41Sopenharmony_ci-->
3691cb0ef41Sopenharmony_ci
3701cb0ef41Sopenharmony_ciExpose the [Web Crypto API][] on the global scope.
3711cb0ef41Sopenharmony_ci
3721cb0ef41Sopenharmony_ci### `--experimental-default-type=type`
3731cb0ef41Sopenharmony_ci
3741cb0ef41Sopenharmony_ci<!-- YAML
3751cb0ef41Sopenharmony_ciadded:
3761cb0ef41Sopenharmony_ci  - v18.19.0
3771cb0ef41Sopenharmony_ci-->
3781cb0ef41Sopenharmony_ci
3791cb0ef41Sopenharmony_ci> Stability: 1.0 - Early development
3801cb0ef41Sopenharmony_ci
3811cb0ef41Sopenharmony_ciDefine which module system, `module` or `commonjs`, to use for the following:
3821cb0ef41Sopenharmony_ci
3831cb0ef41Sopenharmony_ci* String input provided via `--eval` or STDIN, if `--input-type` is unspecified.
3841cb0ef41Sopenharmony_ci
3851cb0ef41Sopenharmony_ci* Files ending in `.js` or with no extension, if there is no `package.json` file
3861cb0ef41Sopenharmony_ci  present in the same folder or any parent folder.
3871cb0ef41Sopenharmony_ci
3881cb0ef41Sopenharmony_ci* Files ending in `.js` or with no extension, if the nearest parent
3891cb0ef41Sopenharmony_ci  `package.json` field lacks a `"type"` field; unless the `package.json` folder
3901cb0ef41Sopenharmony_ci  or any parent folder is inside a `node_modules` folder.
3911cb0ef41Sopenharmony_ci
3921cb0ef41Sopenharmony_ciIn other words, `--experimental-default-type=module` flips all the places where
3931cb0ef41Sopenharmony_ciNode.js currently defaults to CommonJS to instead default to ECMAScript modules,
3941cb0ef41Sopenharmony_ciwith the exception of folders and subfolders below `node_modules`, for backward
3951cb0ef41Sopenharmony_cicompatibility.
3961cb0ef41Sopenharmony_ci
3971cb0ef41Sopenharmony_ciUnder `--experimental-default-type=module` and `--experimental-wasm-modules`,
3981cb0ef41Sopenharmony_cifiles with no extension will be treated as WebAssembly if they begin with the
3991cb0ef41Sopenharmony_ciWebAssembly magic number (`\0asm`); otherwise they will be treated as ES module
4001cb0ef41Sopenharmony_ciJavaScript.
4011cb0ef41Sopenharmony_ci
4021cb0ef41Sopenharmony_ci### `--experimental-import-meta-resolve`
4031cb0ef41Sopenharmony_ci
4041cb0ef41Sopenharmony_ci<!-- YAML
4051cb0ef41Sopenharmony_ciadded:
4061cb0ef41Sopenharmony_ci  - v13.9.0
4071cb0ef41Sopenharmony_ci  - v12.16.2
4081cb0ef41Sopenharmony_cichanges:
4091cb0ef41Sopenharmony_ci  - version: v18.19.0
4101cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/49028
4111cb0ef41Sopenharmony_ci    description: synchronous import.meta.resolve made available by default, with
4121cb0ef41Sopenharmony_ci                 the flag retained for enabling the experimental second argument
4131cb0ef41Sopenharmony_ci                 as previously supported.
4141cb0ef41Sopenharmony_ci-->
4151cb0ef41Sopenharmony_ci
4161cb0ef41Sopenharmony_ciEnable experimental `import.meta.resolve()` parent URL support, which allows
4171cb0ef41Sopenharmony_cipassing a second `parentURL` argument for contextual resolution.
4181cb0ef41Sopenharmony_ci
4191cb0ef41Sopenharmony_ciPreviously gated the entire `import.meta.resolve` feature.
4201cb0ef41Sopenharmony_ci
4211cb0ef41Sopenharmony_ci### `--experimental-loader=module`
4221cb0ef41Sopenharmony_ci
4231cb0ef41Sopenharmony_ci<!-- YAML
4241cb0ef41Sopenharmony_ciadded: v8.8.0
4251cb0ef41Sopenharmony_cichanges:
4261cb0ef41Sopenharmony_ci  - version: v12.11.1
4271cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/29752
4281cb0ef41Sopenharmony_ci    description: This flag was renamed from `--loader` to
4291cb0ef41Sopenharmony_ci                 `--experimental-loader`.
4301cb0ef41Sopenharmony_ci-->
4311cb0ef41Sopenharmony_ci
4321cb0ef41Sopenharmony_ci> This flag is discouraged and may be removed in a future version of Node.js.
4331cb0ef41Sopenharmony_ci> Please use
4341cb0ef41Sopenharmony_ci> [`--import` with `register()`][module customization hooks: enabling] instead.
4351cb0ef41Sopenharmony_ci
4361cb0ef41Sopenharmony_ciSpecify the `module` containing exported [module customization hooks][].
4371cb0ef41Sopenharmony_ci`module` may be any string accepted as an [`import` specifier][].
4381cb0ef41Sopenharmony_ci
4391cb0ef41Sopenharmony_ci### `--experimental-network-imports`
4401cb0ef41Sopenharmony_ci
4411cb0ef41Sopenharmony_ci<!-- YAML
4421cb0ef41Sopenharmony_ciadded: v17.6.0
4431cb0ef41Sopenharmony_ci-->
4441cb0ef41Sopenharmony_ci
4451cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
4461cb0ef41Sopenharmony_ci
4471cb0ef41Sopenharmony_ciEnable experimental support for the `https:` protocol in `import` specifiers.
4481cb0ef41Sopenharmony_ci
4491cb0ef41Sopenharmony_ci### `--experimental-policy`
4501cb0ef41Sopenharmony_ci
4511cb0ef41Sopenharmony_ci<!-- YAML
4521cb0ef41Sopenharmony_ciadded: v11.8.0
4531cb0ef41Sopenharmony_ci-->
4541cb0ef41Sopenharmony_ci
4551cb0ef41Sopenharmony_ciUse the specified file as a security policy.
4561cb0ef41Sopenharmony_ci
4571cb0ef41Sopenharmony_ci### `--no-experimental-fetch`
4581cb0ef41Sopenharmony_ci
4591cb0ef41Sopenharmony_ci<!-- YAML
4601cb0ef41Sopenharmony_ciadded: v18.0.0
4611cb0ef41Sopenharmony_ci-->
4621cb0ef41Sopenharmony_ci
4631cb0ef41Sopenharmony_ciDisable experimental support for the [Fetch API][].
4641cb0ef41Sopenharmony_ci
4651cb0ef41Sopenharmony_ci### `--no-experimental-repl-await`
4661cb0ef41Sopenharmony_ci
4671cb0ef41Sopenharmony_ci<!-- YAML
4681cb0ef41Sopenharmony_ciadded: v16.6.0
4691cb0ef41Sopenharmony_ci-->
4701cb0ef41Sopenharmony_ci
4711cb0ef41Sopenharmony_ciUse this flag to disable top-level await in REPL.
4721cb0ef41Sopenharmony_ci
4731cb0ef41Sopenharmony_ci### `--experimental-shadow-realm`
4741cb0ef41Sopenharmony_ci
4751cb0ef41Sopenharmony_ci<!-- YAML
4761cb0ef41Sopenharmony_ciadded: v18.13.0
4771cb0ef41Sopenharmony_ci-->
4781cb0ef41Sopenharmony_ci
4791cb0ef41Sopenharmony_ciUse this flag to enable [ShadowRealm][] support.
4801cb0ef41Sopenharmony_ci
4811cb0ef41Sopenharmony_ci### `--experimental-specifier-resolution=mode`
4821cb0ef41Sopenharmony_ci
4831cb0ef41Sopenharmony_ci<!-- YAML
4841cb0ef41Sopenharmony_ciadded:
4851cb0ef41Sopenharmony_ci - v13.4.0
4861cb0ef41Sopenharmony_ci - v12.16.0
4871cb0ef41Sopenharmony_ci-->
4881cb0ef41Sopenharmony_ci
4891cb0ef41Sopenharmony_ciSets the resolution algorithm for resolving ES module specifiers. Valid options
4901cb0ef41Sopenharmony_ciare `explicit` and `node`.
4911cb0ef41Sopenharmony_ci
4921cb0ef41Sopenharmony_ciThe default is `explicit`, which requires providing the full path to a
4931cb0ef41Sopenharmony_cimodule. The `node` mode enables support for optional file extensions and
4941cb0ef41Sopenharmony_cithe ability to import a directory that has an index file.
4951cb0ef41Sopenharmony_ci
4961cb0ef41Sopenharmony_ciSee [customizing ESM specifier resolution][] for example usage.
4971cb0ef41Sopenharmony_ci
4981cb0ef41Sopenharmony_ci### `--experimental-test-coverage`
4991cb0ef41Sopenharmony_ci
5001cb0ef41Sopenharmony_ci<!-- YAML
5011cb0ef41Sopenharmony_ciadded: v18.15.0
5021cb0ef41Sopenharmony_cichanges:
5031cb0ef41Sopenharmony_ci  - version: v18.17.0
5041cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/47686
5051cb0ef41Sopenharmony_ci    description: This option can be used with `--test`.
5061cb0ef41Sopenharmony_ci-->
5071cb0ef41Sopenharmony_ci
5081cb0ef41Sopenharmony_ciWhen used in conjunction with the `node:test` module, a code coverage report is
5091cb0ef41Sopenharmony_cigenerated as part of the test runner output. If no tests are run, a coverage
5101cb0ef41Sopenharmony_cireport is not generated. See the documentation on
5111cb0ef41Sopenharmony_ci[collecting code coverage from tests][] for more details.
5121cb0ef41Sopenharmony_ci
5131cb0ef41Sopenharmony_ci### `--experimental-vm-modules`
5141cb0ef41Sopenharmony_ci
5151cb0ef41Sopenharmony_ci<!-- YAML
5161cb0ef41Sopenharmony_ciadded: v9.6.0
5171cb0ef41Sopenharmony_ci-->
5181cb0ef41Sopenharmony_ci
5191cb0ef41Sopenharmony_ciEnable experimental ES Module support in the `node:vm` module.
5201cb0ef41Sopenharmony_ci
5211cb0ef41Sopenharmony_ci### `--experimental-wasi-unstable-preview1`
5221cb0ef41Sopenharmony_ci
5231cb0ef41Sopenharmony_ci<!-- YAML
5241cb0ef41Sopenharmony_ciadded:
5251cb0ef41Sopenharmony_ci  - v13.3.0
5261cb0ef41Sopenharmony_ci  - v12.16.0
5271cb0ef41Sopenharmony_cichanges:
5281cb0ef41Sopenharmony_ci  - version: v18.17.0
5291cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/47286
5301cb0ef41Sopenharmony_ci    description: This option is no longer required as WASI is
5311cb0ef41Sopenharmony_ci                 enabled by default, but can still be passed.
5321cb0ef41Sopenharmony_ci  - version: v13.6.0
5331cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/30980
5341cb0ef41Sopenharmony_ci    description: changed from `--experimental-wasi-unstable-preview0` to
5351cb0ef41Sopenharmony_ci                 `--experimental-wasi-unstable-preview1`.
5361cb0ef41Sopenharmony_ci-->
5371cb0ef41Sopenharmony_ci
5381cb0ef41Sopenharmony_ciEnable experimental WebAssembly System Interface (WASI) support.
5391cb0ef41Sopenharmony_ci
5401cb0ef41Sopenharmony_ci### `--experimental-wasm-modules`
5411cb0ef41Sopenharmony_ci
5421cb0ef41Sopenharmony_ci<!-- YAML
5431cb0ef41Sopenharmony_ciadded: v12.3.0
5441cb0ef41Sopenharmony_ci-->
5451cb0ef41Sopenharmony_ci
5461cb0ef41Sopenharmony_ciEnable experimental WebAssembly module support.
5471cb0ef41Sopenharmony_ci
5481cb0ef41Sopenharmony_ci### `--force-context-aware`
5491cb0ef41Sopenharmony_ci
5501cb0ef41Sopenharmony_ci<!-- YAML
5511cb0ef41Sopenharmony_ciadded: v12.12.0
5521cb0ef41Sopenharmony_ci-->
5531cb0ef41Sopenharmony_ci
5541cb0ef41Sopenharmony_ciDisable loading native addons that are not [context-aware][].
5551cb0ef41Sopenharmony_ci
5561cb0ef41Sopenharmony_ci### `--force-fips`
5571cb0ef41Sopenharmony_ci
5581cb0ef41Sopenharmony_ci<!-- YAML
5591cb0ef41Sopenharmony_ciadded: v6.0.0
5601cb0ef41Sopenharmony_ci-->
5611cb0ef41Sopenharmony_ci
5621cb0ef41Sopenharmony_ciForce FIPS-compliant crypto on startup. (Cannot be disabled from script code.)
5631cb0ef41Sopenharmony_ci(Same requirements as `--enable-fips`.)
5641cb0ef41Sopenharmony_ci
5651cb0ef41Sopenharmony_ci### `--frozen-intrinsics`
5661cb0ef41Sopenharmony_ci
5671cb0ef41Sopenharmony_ci<!-- YAML
5681cb0ef41Sopenharmony_ciadded: v11.12.0
5691cb0ef41Sopenharmony_ci-->
5701cb0ef41Sopenharmony_ci
5711cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
5721cb0ef41Sopenharmony_ci
5731cb0ef41Sopenharmony_ciEnable experimental frozen intrinsics like `Array` and `Object`.
5741cb0ef41Sopenharmony_ci
5751cb0ef41Sopenharmony_ciOnly the root context is supported. There is no guarantee that
5761cb0ef41Sopenharmony_ci`globalThis.Array` is indeed the default intrinsic reference. Code may break
5771cb0ef41Sopenharmony_ciunder this flag.
5781cb0ef41Sopenharmony_ci
5791cb0ef41Sopenharmony_ciTo allow polyfills to be added,
5801cb0ef41Sopenharmony_ci[`--require`][] and [`--import`][] both run before freezing intrinsics.
5811cb0ef41Sopenharmony_ci
5821cb0ef41Sopenharmony_ci### `--force-node-api-uncaught-exceptions-policy`
5831cb0ef41Sopenharmony_ci
5841cb0ef41Sopenharmony_ci<!-- YAML
5851cb0ef41Sopenharmony_ciadded: v18.3.0
5861cb0ef41Sopenharmony_ci-->
5871cb0ef41Sopenharmony_ci
5881cb0ef41Sopenharmony_ciEnforces `uncaughtException` event on Node-API asynchronous callbacks.
5891cb0ef41Sopenharmony_ci
5901cb0ef41Sopenharmony_ciTo prevent from an existing add-on from crashing the process, this flag is not
5911cb0ef41Sopenharmony_cienabled by default. In the future, this flag will be enabled by default to
5921cb0ef41Sopenharmony_cienforce the correct behavior.
5931cb0ef41Sopenharmony_ci
5941cb0ef41Sopenharmony_ci### `--heapsnapshot-near-heap-limit=max_count`
5951cb0ef41Sopenharmony_ci
5961cb0ef41Sopenharmony_ci<!-- YAML
5971cb0ef41Sopenharmony_ciadded:
5981cb0ef41Sopenharmony_ci  - v15.1.0
5991cb0ef41Sopenharmony_ci  - v14.18.0
6001cb0ef41Sopenharmony_ci-->
6011cb0ef41Sopenharmony_ci
6021cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
6031cb0ef41Sopenharmony_ci
6041cb0ef41Sopenharmony_ciWrites a V8 heap snapshot to disk when the V8 heap usage is approaching the
6051cb0ef41Sopenharmony_ciheap limit. `count` should be a non-negative integer (in which case
6061cb0ef41Sopenharmony_ciNode.js will write no more than `max_count` snapshots to disk).
6071cb0ef41Sopenharmony_ci
6081cb0ef41Sopenharmony_ciWhen generating snapshots, garbage collection may be triggered and bring
6091cb0ef41Sopenharmony_cithe heap usage down. Therefore multiple snapshots may be written to disk
6101cb0ef41Sopenharmony_cibefore the Node.js instance finally runs out of memory. These heap snapshots
6111cb0ef41Sopenharmony_cican be compared to determine what objects are being allocated during the
6121cb0ef41Sopenharmony_citime consecutive snapshots are taken. It's not guaranteed that Node.js will
6131cb0ef41Sopenharmony_ciwrite exactly `max_count` snapshots to disk, but it will try
6141cb0ef41Sopenharmony_ciits best to generate at least one and up to `max_count` snapshots before the
6151cb0ef41Sopenharmony_ciNode.js instance runs out of memory when `max_count` is greater than `0`.
6161cb0ef41Sopenharmony_ci
6171cb0ef41Sopenharmony_ciGenerating V8 snapshots takes time and memory (both memory managed by the
6181cb0ef41Sopenharmony_ciV8 heap and native memory outside the V8 heap). The bigger the heap is,
6191cb0ef41Sopenharmony_cithe more resources it needs. Node.js will adjust the V8 heap to accommodate
6201cb0ef41Sopenharmony_cithe additional V8 heap memory overhead, and try its best to avoid using up
6211cb0ef41Sopenharmony_ciall the memory available to the process. When the process uses
6221cb0ef41Sopenharmony_cimore memory than the system deems appropriate, the process may be terminated
6231cb0ef41Sopenharmony_ciabruptly by the system, depending on the system configuration.
6241cb0ef41Sopenharmony_ci
6251cb0ef41Sopenharmony_ci```console
6261cb0ef41Sopenharmony_ci$ node --max-old-space-size=100 --heapsnapshot-near-heap-limit=3 index.js
6271cb0ef41Sopenharmony_ciWrote snapshot to Heap.20200430.100036.49580.0.001.heapsnapshot
6281cb0ef41Sopenharmony_ciWrote snapshot to Heap.20200430.100037.49580.0.002.heapsnapshot
6291cb0ef41Sopenharmony_ciWrote snapshot to Heap.20200430.100038.49580.0.003.heapsnapshot
6301cb0ef41Sopenharmony_ci
6311cb0ef41Sopenharmony_ci<--- Last few GCs --->
6321cb0ef41Sopenharmony_ci
6331cb0ef41Sopenharmony_ci[49580:0x110000000]     4826 ms: Mark-sweep 130.6 (147.8) -> 130.5 (147.8) MB, 27.4 / 0.0 ms  (average mu = 0.126, current mu = 0.034) allocation failure scavenge might not succeed
6341cb0ef41Sopenharmony_ci[49580:0x110000000]     4845 ms: Mark-sweep 130.6 (147.8) -> 130.6 (147.8) MB, 18.8 / 0.0 ms  (average mu = 0.088, current mu = 0.031) allocation failure scavenge might not succeed
6351cb0ef41Sopenharmony_ci
6361cb0ef41Sopenharmony_ci
6371cb0ef41Sopenharmony_ci<--- JS stacktrace --->
6381cb0ef41Sopenharmony_ci
6391cb0ef41Sopenharmony_ciFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
6401cb0ef41Sopenharmony_ci....
6411cb0ef41Sopenharmony_ci```
6421cb0ef41Sopenharmony_ci
6431cb0ef41Sopenharmony_ci### `--heapsnapshot-signal=signal`
6441cb0ef41Sopenharmony_ci
6451cb0ef41Sopenharmony_ci<!-- YAML
6461cb0ef41Sopenharmony_ciadded: v12.0.0
6471cb0ef41Sopenharmony_ci-->
6481cb0ef41Sopenharmony_ci
6491cb0ef41Sopenharmony_ciEnables a signal handler that causes the Node.js process to write a heap dump
6501cb0ef41Sopenharmony_ciwhen the specified signal is received. `signal` must be a valid signal name.
6511cb0ef41Sopenharmony_ciDisabled by default.
6521cb0ef41Sopenharmony_ci
6531cb0ef41Sopenharmony_ci```console
6541cb0ef41Sopenharmony_ci$ node --heapsnapshot-signal=SIGUSR2 index.js &
6551cb0ef41Sopenharmony_ci$ ps aux
6561cb0ef41Sopenharmony_ciUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
6571cb0ef41Sopenharmony_cinode         1  5.5  6.1 787252 247004 ?       Ssl  16:43   0:02 node --heapsnapshot-signal=SIGUSR2 index.js
6581cb0ef41Sopenharmony_ci$ kill -USR2 1
6591cb0ef41Sopenharmony_ci$ ls
6601cb0ef41Sopenharmony_ciHeap.20190718.133405.15554.0.001.heapsnapshot
6611cb0ef41Sopenharmony_ci```
6621cb0ef41Sopenharmony_ci
6631cb0ef41Sopenharmony_ci### `--heap-prof`
6641cb0ef41Sopenharmony_ci
6651cb0ef41Sopenharmony_ci<!-- YAML
6661cb0ef41Sopenharmony_ciadded: v12.4.0
6671cb0ef41Sopenharmony_ci-->
6681cb0ef41Sopenharmony_ci
6691cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
6701cb0ef41Sopenharmony_ci
6711cb0ef41Sopenharmony_ciStarts the V8 heap profiler on start up, and writes the heap profile to disk
6721cb0ef41Sopenharmony_cibefore exit.
6731cb0ef41Sopenharmony_ci
6741cb0ef41Sopenharmony_ciIf `--heap-prof-dir` is not specified, the generated profile is placed
6751cb0ef41Sopenharmony_ciin the current working directory.
6761cb0ef41Sopenharmony_ci
6771cb0ef41Sopenharmony_ciIf `--heap-prof-name` is not specified, the generated profile is
6781cb0ef41Sopenharmony_cinamed `Heap.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.heapprofile`.
6791cb0ef41Sopenharmony_ci
6801cb0ef41Sopenharmony_ci```console
6811cb0ef41Sopenharmony_ci$ node --heap-prof index.js
6821cb0ef41Sopenharmony_ci$ ls *.heapprofile
6831cb0ef41Sopenharmony_ciHeap.20190409.202950.15293.0.001.heapprofile
6841cb0ef41Sopenharmony_ci```
6851cb0ef41Sopenharmony_ci
6861cb0ef41Sopenharmony_ci### `--heap-prof-dir`
6871cb0ef41Sopenharmony_ci
6881cb0ef41Sopenharmony_ci<!-- YAML
6891cb0ef41Sopenharmony_ciadded: v12.4.0
6901cb0ef41Sopenharmony_ci-->
6911cb0ef41Sopenharmony_ci
6921cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
6931cb0ef41Sopenharmony_ci
6941cb0ef41Sopenharmony_ciSpecify the directory where the heap profiles generated by `--heap-prof` will
6951cb0ef41Sopenharmony_cibe placed.
6961cb0ef41Sopenharmony_ci
6971cb0ef41Sopenharmony_ciThe default value is controlled by the
6981cb0ef41Sopenharmony_ci[`--diagnostic-dir`][] command-line option.
6991cb0ef41Sopenharmony_ci
7001cb0ef41Sopenharmony_ci### `--heap-prof-interval`
7011cb0ef41Sopenharmony_ci
7021cb0ef41Sopenharmony_ci<!-- YAML
7031cb0ef41Sopenharmony_ciadded: v12.4.0
7041cb0ef41Sopenharmony_ci-->
7051cb0ef41Sopenharmony_ci
7061cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
7071cb0ef41Sopenharmony_ci
7081cb0ef41Sopenharmony_ciSpecify the average sampling interval in bytes for the heap profiles generated
7091cb0ef41Sopenharmony_ciby `--heap-prof`. The default is 512 \* 1024 bytes.
7101cb0ef41Sopenharmony_ci
7111cb0ef41Sopenharmony_ci### `--heap-prof-name`
7121cb0ef41Sopenharmony_ci
7131cb0ef41Sopenharmony_ci<!-- YAML
7141cb0ef41Sopenharmony_ciadded: v12.4.0
7151cb0ef41Sopenharmony_ci-->
7161cb0ef41Sopenharmony_ci
7171cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
7181cb0ef41Sopenharmony_ci
7191cb0ef41Sopenharmony_ciSpecify the file name of the heap profile generated by `--heap-prof`.
7201cb0ef41Sopenharmony_ci
7211cb0ef41Sopenharmony_ci### `--icu-data-dir=file`
7221cb0ef41Sopenharmony_ci
7231cb0ef41Sopenharmony_ci<!-- YAML
7241cb0ef41Sopenharmony_ciadded: v0.11.15
7251cb0ef41Sopenharmony_ci-->
7261cb0ef41Sopenharmony_ci
7271cb0ef41Sopenharmony_ciSpecify ICU data load path. (Overrides `NODE_ICU_DATA`.)
7281cb0ef41Sopenharmony_ci
7291cb0ef41Sopenharmony_ci### `--import=module`
7301cb0ef41Sopenharmony_ci
7311cb0ef41Sopenharmony_ci<!-- YAML
7321cb0ef41Sopenharmony_ciadded: v18.18.0
7331cb0ef41Sopenharmony_ci-->
7341cb0ef41Sopenharmony_ci
7351cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
7361cb0ef41Sopenharmony_ci
7371cb0ef41Sopenharmony_ciPreload the specified module at startup.
7381cb0ef41Sopenharmony_ci
7391cb0ef41Sopenharmony_ciFollows [ECMAScript module][] resolution rules.
7401cb0ef41Sopenharmony_ciUse [`--require`][] to load a [CommonJS module][].
7411cb0ef41Sopenharmony_ciModules preloaded with `--require` will run before modules preloaded with `--import`.
7421cb0ef41Sopenharmony_ci
7431cb0ef41Sopenharmony_ci### `--input-type=type`
7441cb0ef41Sopenharmony_ci
7451cb0ef41Sopenharmony_ci<!-- YAML
7461cb0ef41Sopenharmony_ciadded: v12.0.0
7471cb0ef41Sopenharmony_ci-->
7481cb0ef41Sopenharmony_ci
7491cb0ef41Sopenharmony_ciThis configures Node.js to interpret string input as CommonJS or as an ES
7501cb0ef41Sopenharmony_cimodule. String input is input via `--eval`, `--print`, or `STDIN`.
7511cb0ef41Sopenharmony_ci
7521cb0ef41Sopenharmony_ciValid values are `"commonjs"` and `"module"`. The default is `"commonjs"`.
7531cb0ef41Sopenharmony_ci
7541cb0ef41Sopenharmony_ciThe REPL does not support this option.
7551cb0ef41Sopenharmony_ci
7561cb0ef41Sopenharmony_ci### `--inspect-brk[=[host:]port]`
7571cb0ef41Sopenharmony_ci
7581cb0ef41Sopenharmony_ci<!-- YAML
7591cb0ef41Sopenharmony_ciadded: v7.6.0
7601cb0ef41Sopenharmony_ci-->
7611cb0ef41Sopenharmony_ci
7621cb0ef41Sopenharmony_ciActivate inspector on `host:port` and break at start of user script.
7631cb0ef41Sopenharmony_ciDefault `host:port` is `127.0.0.1:9229`.
7641cb0ef41Sopenharmony_ci
7651cb0ef41Sopenharmony_ci### `--inspect-port=[host:]port`
7661cb0ef41Sopenharmony_ci
7671cb0ef41Sopenharmony_ci<!-- YAML
7681cb0ef41Sopenharmony_ciadded: v7.6.0
7691cb0ef41Sopenharmony_ci-->
7701cb0ef41Sopenharmony_ci
7711cb0ef41Sopenharmony_ciSet the `host:port` to be used when the inspector is activated.
7721cb0ef41Sopenharmony_ciUseful when activating the inspector by sending the `SIGUSR1` signal.
7731cb0ef41Sopenharmony_ci
7741cb0ef41Sopenharmony_ciDefault host is `127.0.0.1`.
7751cb0ef41Sopenharmony_ci
7761cb0ef41Sopenharmony_ciSee the [security warning][] below regarding the `host`
7771cb0ef41Sopenharmony_ciparameter usage.
7781cb0ef41Sopenharmony_ci
7791cb0ef41Sopenharmony_ci### `--inspect[=[host:]port]`
7801cb0ef41Sopenharmony_ci
7811cb0ef41Sopenharmony_ci<!-- YAML
7821cb0ef41Sopenharmony_ciadded: v6.3.0
7831cb0ef41Sopenharmony_ci-->
7841cb0ef41Sopenharmony_ci
7851cb0ef41Sopenharmony_ciActivate inspector on `host:port`. Default is `127.0.0.1:9229`.
7861cb0ef41Sopenharmony_ci
7871cb0ef41Sopenharmony_ciV8 inspector integration allows tools such as Chrome DevTools and IDEs to debug
7881cb0ef41Sopenharmony_ciand profile Node.js instances. The tools attach to Node.js instances via a
7891cb0ef41Sopenharmony_citcp port and communicate using the [Chrome DevTools Protocol][].
7901cb0ef41Sopenharmony_ci
7911cb0ef41Sopenharmony_ci<!-- Anchor to make sure old links find a target -->
7921cb0ef41Sopenharmony_ci
7931cb0ef41Sopenharmony_ci<a id="inspector_security"></a>
7941cb0ef41Sopenharmony_ci
7951cb0ef41Sopenharmony_ci#### Warning: binding inspector to a public IP:port combination is insecure
7961cb0ef41Sopenharmony_ci
7971cb0ef41Sopenharmony_ciBinding the inspector to a public IP (including `0.0.0.0`) with an open port is
7981cb0ef41Sopenharmony_ciinsecure, as it allows external hosts to connect to the inspector and perform
7991cb0ef41Sopenharmony_cia [remote code execution][] attack.
8001cb0ef41Sopenharmony_ci
8011cb0ef41Sopenharmony_ciIf specifying a host, make sure that either:
8021cb0ef41Sopenharmony_ci
8031cb0ef41Sopenharmony_ci* The host is not accessible from public networks.
8041cb0ef41Sopenharmony_ci* A firewall disallows unwanted connections on the port.
8051cb0ef41Sopenharmony_ci
8061cb0ef41Sopenharmony_ci**More specifically, `--inspect=0.0.0.0` is insecure if the port (`9229` by
8071cb0ef41Sopenharmony_cidefault) is not firewall-protected.**
8081cb0ef41Sopenharmony_ci
8091cb0ef41Sopenharmony_ciSee the [debugging security implications][] section for more information.
8101cb0ef41Sopenharmony_ci
8111cb0ef41Sopenharmony_ci### `--inspect-publish-uid=stderr,http`
8121cb0ef41Sopenharmony_ci
8131cb0ef41Sopenharmony_ciSpecify ways of the inspector web socket url exposure.
8141cb0ef41Sopenharmony_ci
8151cb0ef41Sopenharmony_ciBy default inspector websocket url is available in stderr and under `/json/list`
8161cb0ef41Sopenharmony_ciendpoint on `http://host:port/json/list`.
8171cb0ef41Sopenharmony_ci
8181cb0ef41Sopenharmony_ci### `--insecure-http-parser`
8191cb0ef41Sopenharmony_ci
8201cb0ef41Sopenharmony_ci<!-- YAML
8211cb0ef41Sopenharmony_ciadded:
8221cb0ef41Sopenharmony_ci - v13.4.0
8231cb0ef41Sopenharmony_ci - v12.15.0
8241cb0ef41Sopenharmony_ci - v10.19.0
8251cb0ef41Sopenharmony_ci-->
8261cb0ef41Sopenharmony_ci
8271cb0ef41Sopenharmony_ciUse an insecure HTTP parser that accepts invalid HTTP headers. This may allow
8281cb0ef41Sopenharmony_ciinteroperability with non-conformant HTTP implementations. It may also allow
8291cb0ef41Sopenharmony_cirequest smuggling and other HTTP attacks that rely on invalid headers being
8301cb0ef41Sopenharmony_ciaccepted. Avoid using this option.
8311cb0ef41Sopenharmony_ci
8321cb0ef41Sopenharmony_ci### `--jitless`
8331cb0ef41Sopenharmony_ci
8341cb0ef41Sopenharmony_ci<!-- YAML
8351cb0ef41Sopenharmony_ciadded: v12.0.0
8361cb0ef41Sopenharmony_ci-->
8371cb0ef41Sopenharmony_ci
8381cb0ef41Sopenharmony_ciDisable [runtime allocation of executable memory][jitless]. This may be
8391cb0ef41Sopenharmony_cirequired on some platforms for security reasons. It can also reduce attack
8401cb0ef41Sopenharmony_cisurface on other platforms, but the performance impact may be severe.
8411cb0ef41Sopenharmony_ci
8421cb0ef41Sopenharmony_ciThis flag is inherited from V8 and is subject to change upstream. It may
8431cb0ef41Sopenharmony_cidisappear in a non-semver-major release.
8441cb0ef41Sopenharmony_ci
8451cb0ef41Sopenharmony_ci### `--max-http-header-size=size`
8461cb0ef41Sopenharmony_ci
8471cb0ef41Sopenharmony_ci<!-- YAML
8481cb0ef41Sopenharmony_ciadded:
8491cb0ef41Sopenharmony_ci - v11.6.0
8501cb0ef41Sopenharmony_ci - v10.15.0
8511cb0ef41Sopenharmony_cichanges:
8521cb0ef41Sopenharmony_ci  - version: v13.13.0
8531cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/32520
8541cb0ef41Sopenharmony_ci    description: Change maximum default size of HTTP headers from 8 KiB to 16 KiB.
8551cb0ef41Sopenharmony_ci-->
8561cb0ef41Sopenharmony_ci
8571cb0ef41Sopenharmony_ciSpecify the maximum size, in bytes, of HTTP headers. Defaults to 16 KiB.
8581cb0ef41Sopenharmony_ci
8591cb0ef41Sopenharmony_ci### `--napi-modules`
8601cb0ef41Sopenharmony_ci
8611cb0ef41Sopenharmony_ci<!-- YAML
8621cb0ef41Sopenharmony_ciadded: v7.10.0
8631cb0ef41Sopenharmony_ci-->
8641cb0ef41Sopenharmony_ci
8651cb0ef41Sopenharmony_ciThis option is a no-op. It is kept for compatibility.
8661cb0ef41Sopenharmony_ci
8671cb0ef41Sopenharmony_ci### `--no-addons`
8681cb0ef41Sopenharmony_ci
8691cb0ef41Sopenharmony_ci<!-- YAML
8701cb0ef41Sopenharmony_ciadded:
8711cb0ef41Sopenharmony_ci  - v16.10.0
8721cb0ef41Sopenharmony_ci  - v14.19.0
8731cb0ef41Sopenharmony_ci-->
8741cb0ef41Sopenharmony_ci
8751cb0ef41Sopenharmony_ciDisable the `node-addons` exports condition as well as disable loading
8761cb0ef41Sopenharmony_cinative addons. When `--no-addons` is specified, calling `process.dlopen` or
8771cb0ef41Sopenharmony_cirequiring a native C++ addon will fail and throw an exception.
8781cb0ef41Sopenharmony_ci
8791cb0ef41Sopenharmony_ci### `--no-deprecation`
8801cb0ef41Sopenharmony_ci
8811cb0ef41Sopenharmony_ci<!-- YAML
8821cb0ef41Sopenharmony_ciadded: v0.8.0
8831cb0ef41Sopenharmony_ci-->
8841cb0ef41Sopenharmony_ci
8851cb0ef41Sopenharmony_ciSilence deprecation warnings.
8861cb0ef41Sopenharmony_ci
8871cb0ef41Sopenharmony_ci### `--no-extra-info-on-fatal-exception`
8881cb0ef41Sopenharmony_ci
8891cb0ef41Sopenharmony_ci<!-- YAML
8901cb0ef41Sopenharmony_ciadded: v17.0.0
8911cb0ef41Sopenharmony_ci-->
8921cb0ef41Sopenharmony_ci
8931cb0ef41Sopenharmony_ciHide extra information on fatal exception that causes exit.
8941cb0ef41Sopenharmony_ci
8951cb0ef41Sopenharmony_ci### `--no-force-async-hooks-checks`
8961cb0ef41Sopenharmony_ci
8971cb0ef41Sopenharmony_ci<!-- YAML
8981cb0ef41Sopenharmony_ciadded: v9.0.0
8991cb0ef41Sopenharmony_ci-->
9001cb0ef41Sopenharmony_ci
9011cb0ef41Sopenharmony_ciDisables runtime checks for `async_hooks`. These will still be enabled
9021cb0ef41Sopenharmony_cidynamically when `async_hooks` is enabled.
9031cb0ef41Sopenharmony_ci
9041cb0ef41Sopenharmony_ci### `--no-global-search-paths`
9051cb0ef41Sopenharmony_ci
9061cb0ef41Sopenharmony_ci<!-- YAML
9071cb0ef41Sopenharmony_ciadded: v16.10.0
9081cb0ef41Sopenharmony_ci-->
9091cb0ef41Sopenharmony_ci
9101cb0ef41Sopenharmony_ciDo not search modules from global paths like `$HOME/.node_modules` and
9111cb0ef41Sopenharmony_ci`$NODE_PATH`.
9121cb0ef41Sopenharmony_ci
9131cb0ef41Sopenharmony_ci### `--no-warnings`
9141cb0ef41Sopenharmony_ci
9151cb0ef41Sopenharmony_ci<!-- YAML
9161cb0ef41Sopenharmony_ciadded: v6.0.0
9171cb0ef41Sopenharmony_ci-->
9181cb0ef41Sopenharmony_ci
9191cb0ef41Sopenharmony_ciSilence all process warnings (including deprecations).
9201cb0ef41Sopenharmony_ci
9211cb0ef41Sopenharmony_ci### `--node-memory-debug`
9221cb0ef41Sopenharmony_ci
9231cb0ef41Sopenharmony_ci<!-- YAML
9241cb0ef41Sopenharmony_ciadded:
9251cb0ef41Sopenharmony_ci  - v15.0.0
9261cb0ef41Sopenharmony_ci  - v14.18.0
9271cb0ef41Sopenharmony_ci-->
9281cb0ef41Sopenharmony_ci
9291cb0ef41Sopenharmony_ciEnable extra debug checks for memory leaks in Node.js internals. This is
9301cb0ef41Sopenharmony_ciusually only useful for developers debugging Node.js itself.
9311cb0ef41Sopenharmony_ci
9321cb0ef41Sopenharmony_ci### `--openssl-config=file`
9331cb0ef41Sopenharmony_ci
9341cb0ef41Sopenharmony_ci<!-- YAML
9351cb0ef41Sopenharmony_ciadded: v6.9.0
9361cb0ef41Sopenharmony_ci-->
9371cb0ef41Sopenharmony_ci
9381cb0ef41Sopenharmony_ciLoad an OpenSSL configuration file on startup. Among other uses, this can be
9391cb0ef41Sopenharmony_ciused to enable FIPS-compliant crypto if Node.js is built
9401cb0ef41Sopenharmony_ciagainst FIPS-enabled OpenSSL.
9411cb0ef41Sopenharmony_ci
9421cb0ef41Sopenharmony_ci### `--openssl-shared-config`
9431cb0ef41Sopenharmony_ci
9441cb0ef41Sopenharmony_ci<!-- YAML
9451cb0ef41Sopenharmony_ciadded: v18.5.0
9461cb0ef41Sopenharmony_ci-->
9471cb0ef41Sopenharmony_ci
9481cb0ef41Sopenharmony_ciEnable OpenSSL default configuration section, `openssl_conf` to be read from
9491cb0ef41Sopenharmony_cithe OpenSSL configuration file. The default configuration file is named
9501cb0ef41Sopenharmony_ci`openssl.cnf` but this can be changed using the environment variable
9511cb0ef41Sopenharmony_ci`OPENSSL_CONF`, or by using the command line option `--openssl-config`.
9521cb0ef41Sopenharmony_ciThe location of the default OpenSSL configuration file depends on how OpenSSL
9531cb0ef41Sopenharmony_ciis being linked to Node.js. Sharing the OpenSSL configuration may have unwanted
9541cb0ef41Sopenharmony_ciimplications and it is recommended to use a configuration section specific to
9551cb0ef41Sopenharmony_ciNode.js which is `nodejs_conf` and is default when this option is not used.
9561cb0ef41Sopenharmony_ci
9571cb0ef41Sopenharmony_ci### `--openssl-legacy-provider`
9581cb0ef41Sopenharmony_ci
9591cb0ef41Sopenharmony_ci<!-- YAML
9601cb0ef41Sopenharmony_ciadded: v17.0.0
9611cb0ef41Sopenharmony_ci-->
9621cb0ef41Sopenharmony_ci
9631cb0ef41Sopenharmony_ciEnable OpenSSL 3.0 legacy provider. For more information please see
9641cb0ef41Sopenharmony_ci[OSSL\_PROVIDER-legacy][OSSL_PROVIDER-legacy].
9651cb0ef41Sopenharmony_ci
9661cb0ef41Sopenharmony_ci### `--pending-deprecation`
9671cb0ef41Sopenharmony_ci
9681cb0ef41Sopenharmony_ci<!-- YAML
9691cb0ef41Sopenharmony_ciadded: v8.0.0
9701cb0ef41Sopenharmony_ci-->
9711cb0ef41Sopenharmony_ci
9721cb0ef41Sopenharmony_ciEmit pending deprecation warnings.
9731cb0ef41Sopenharmony_ci
9741cb0ef41Sopenharmony_ciPending deprecations are generally identical to a runtime deprecation with the
9751cb0ef41Sopenharmony_cinotable exception that they are turned _off_ by default and will not be emitted
9761cb0ef41Sopenharmony_ciunless either the `--pending-deprecation` command-line flag, or the
9771cb0ef41Sopenharmony_ci`NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations
9781cb0ef41Sopenharmony_ciare used to provide a kind of selective "early warning" mechanism that
9791cb0ef41Sopenharmony_cidevelopers may leverage to detect deprecated API usage.
9801cb0ef41Sopenharmony_ci
9811cb0ef41Sopenharmony_ci### `--policy-integrity=sri`
9821cb0ef41Sopenharmony_ci
9831cb0ef41Sopenharmony_ci<!-- YAML
9841cb0ef41Sopenharmony_ciadded: v12.7.0
9851cb0ef41Sopenharmony_ci-->
9861cb0ef41Sopenharmony_ci
9871cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
9881cb0ef41Sopenharmony_ci
9891cb0ef41Sopenharmony_ciInstructs Node.js to error prior to running any code if the policy does not have
9901cb0ef41Sopenharmony_cithe specified integrity. It expects a [Subresource Integrity][] string as a
9911cb0ef41Sopenharmony_ciparameter.
9921cb0ef41Sopenharmony_ci
9931cb0ef41Sopenharmony_ci### `--preserve-symlinks`
9941cb0ef41Sopenharmony_ci
9951cb0ef41Sopenharmony_ci<!-- YAML
9961cb0ef41Sopenharmony_ciadded: v6.3.0
9971cb0ef41Sopenharmony_ci-->
9981cb0ef41Sopenharmony_ci
9991cb0ef41Sopenharmony_ciInstructs the module loader to preserve symbolic links when resolving and
10001cb0ef41Sopenharmony_cicaching modules.
10011cb0ef41Sopenharmony_ci
10021cb0ef41Sopenharmony_ciBy default, when Node.js loads a module from a path that is symbolically linked
10031cb0ef41Sopenharmony_cito a different on-disk location, Node.js will dereference the link and use the
10041cb0ef41Sopenharmony_ciactual on-disk "real path" of the module as both an identifier and as a root
10051cb0ef41Sopenharmony_cipath to locate other dependency modules. In most cases, this default behavior
10061cb0ef41Sopenharmony_ciis acceptable. However, when using symbolically linked peer dependencies, as
10071cb0ef41Sopenharmony_ciillustrated in the example below, the default behavior causes an exception to
10081cb0ef41Sopenharmony_cibe thrown if `moduleA` attempts to require `moduleB` as a peer dependency:
10091cb0ef41Sopenharmony_ci
10101cb0ef41Sopenharmony_ci```text
10111cb0ef41Sopenharmony_ci{appDir}
10121cb0ef41Sopenharmony_ci ├── app
10131cb0ef41Sopenharmony_ci │   ├── index.js
10141cb0ef41Sopenharmony_ci │   └── node_modules
10151cb0ef41Sopenharmony_ci │       ├── moduleA -> {appDir}/moduleA
10161cb0ef41Sopenharmony_ci │       └── moduleB
10171cb0ef41Sopenharmony_ci │           ├── index.js
10181cb0ef41Sopenharmony_ci │           └── package.json
10191cb0ef41Sopenharmony_ci └── moduleA
10201cb0ef41Sopenharmony_ci     ├── index.js
10211cb0ef41Sopenharmony_ci     └── package.json
10221cb0ef41Sopenharmony_ci```
10231cb0ef41Sopenharmony_ci
10241cb0ef41Sopenharmony_ciThe `--preserve-symlinks` command-line flag instructs Node.js to use the
10251cb0ef41Sopenharmony_cisymlink path for modules as opposed to the real path, allowing symbolically
10261cb0ef41Sopenharmony_cilinked peer dependencies to be found.
10271cb0ef41Sopenharmony_ci
10281cb0ef41Sopenharmony_ciNote, however, that using `--preserve-symlinks` can have other side effects.
10291cb0ef41Sopenharmony_ciSpecifically, symbolically linked _native_ modules can fail to load if those
10301cb0ef41Sopenharmony_ciare linked from more than one location in the dependency tree (Node.js would
10311cb0ef41Sopenharmony_cisee those as two separate modules and would attempt to load the module multiple
10321cb0ef41Sopenharmony_citimes, causing an exception to be thrown).
10331cb0ef41Sopenharmony_ci
10341cb0ef41Sopenharmony_ciThe `--preserve-symlinks` flag does not apply to the main module, which allows
10351cb0ef41Sopenharmony_ci`node --preserve-symlinks node_module/.bin/<foo>` to work. To apply the same
10361cb0ef41Sopenharmony_cibehavior for the main module, also use `--preserve-symlinks-main`.
10371cb0ef41Sopenharmony_ci
10381cb0ef41Sopenharmony_ci### `--preserve-symlinks-main`
10391cb0ef41Sopenharmony_ci
10401cb0ef41Sopenharmony_ci<!-- YAML
10411cb0ef41Sopenharmony_ciadded: v10.2.0
10421cb0ef41Sopenharmony_ci-->
10431cb0ef41Sopenharmony_ci
10441cb0ef41Sopenharmony_ciInstructs the module loader to preserve symbolic links when resolving and
10451cb0ef41Sopenharmony_cicaching the main module (`require.main`).
10461cb0ef41Sopenharmony_ci
10471cb0ef41Sopenharmony_ciThis flag exists so that the main module can be opted-in to the same behavior
10481cb0ef41Sopenharmony_cithat `--preserve-symlinks` gives to all other imports; they are separate flags,
10491cb0ef41Sopenharmony_cihowever, for backward compatibility with older Node.js versions.
10501cb0ef41Sopenharmony_ci
10511cb0ef41Sopenharmony_ci`--preserve-symlinks-main` does not imply `--preserve-symlinks`; use
10521cb0ef41Sopenharmony_ci`--preserve-symlinks-main` in addition to
10531cb0ef41Sopenharmony_ci`--preserve-symlinks` when it is not desirable to follow symlinks before
10541cb0ef41Sopenharmony_ciresolving relative paths.
10551cb0ef41Sopenharmony_ci
10561cb0ef41Sopenharmony_ciSee [`--preserve-symlinks`][] for more information.
10571cb0ef41Sopenharmony_ci
10581cb0ef41Sopenharmony_ci### `--prof`
10591cb0ef41Sopenharmony_ci
10601cb0ef41Sopenharmony_ci<!-- YAML
10611cb0ef41Sopenharmony_ciadded: v2.0.0
10621cb0ef41Sopenharmony_ci-->
10631cb0ef41Sopenharmony_ci
10641cb0ef41Sopenharmony_ciGenerate V8 profiler output.
10651cb0ef41Sopenharmony_ci
10661cb0ef41Sopenharmony_ci### `--prof-process`
10671cb0ef41Sopenharmony_ci
10681cb0ef41Sopenharmony_ci<!-- YAML
10691cb0ef41Sopenharmony_ciadded: v5.2.0
10701cb0ef41Sopenharmony_ci-->
10711cb0ef41Sopenharmony_ci
10721cb0ef41Sopenharmony_ciProcess V8 profiler output generated using the V8 option `--prof`.
10731cb0ef41Sopenharmony_ci
10741cb0ef41Sopenharmony_ci### `--redirect-warnings=file`
10751cb0ef41Sopenharmony_ci
10761cb0ef41Sopenharmony_ci<!-- YAML
10771cb0ef41Sopenharmony_ciadded: v8.0.0
10781cb0ef41Sopenharmony_ci-->
10791cb0ef41Sopenharmony_ci
10801cb0ef41Sopenharmony_ciWrite process warnings to the given file instead of printing to stderr. The
10811cb0ef41Sopenharmony_cifile will be created if it does not exist, and will be appended to if it does.
10821cb0ef41Sopenharmony_ciIf an error occurs while attempting to write the warning to the file, the
10831cb0ef41Sopenharmony_ciwarning will be written to stderr instead.
10841cb0ef41Sopenharmony_ci
10851cb0ef41Sopenharmony_ciThe `file` name may be an absolute path. If it is not, the default directory it
10861cb0ef41Sopenharmony_ciwill be written to is controlled by the
10871cb0ef41Sopenharmony_ci[`--diagnostic-dir`][] command-line option.
10881cb0ef41Sopenharmony_ci
10891cb0ef41Sopenharmony_ci### `--report-compact`
10901cb0ef41Sopenharmony_ci
10911cb0ef41Sopenharmony_ci<!-- YAML
10921cb0ef41Sopenharmony_ciadded:
10931cb0ef41Sopenharmony_ci - v13.12.0
10941cb0ef41Sopenharmony_ci - v12.17.0
10951cb0ef41Sopenharmony_ci-->
10961cb0ef41Sopenharmony_ci
10971cb0ef41Sopenharmony_ciWrite reports in a compact format, single-line JSON, more easily consumable
10981cb0ef41Sopenharmony_ciby log processing systems than the default multi-line format designed for
10991cb0ef41Sopenharmony_cihuman consumption.
11001cb0ef41Sopenharmony_ci
11011cb0ef41Sopenharmony_ci### `--report-dir=directory`, `report-directory=directory`
11021cb0ef41Sopenharmony_ci
11031cb0ef41Sopenharmony_ci<!-- YAML
11041cb0ef41Sopenharmony_ciadded: v11.8.0
11051cb0ef41Sopenharmony_cichanges:
11061cb0ef41Sopenharmony_ci  - version:
11071cb0ef41Sopenharmony_ci     - v13.12.0
11081cb0ef41Sopenharmony_ci     - v12.17.0
11091cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/32242
11101cb0ef41Sopenharmony_ci    description: This option is no longer experimental.
11111cb0ef41Sopenharmony_ci  - version: v12.0.0
11121cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/27312
11131cb0ef41Sopenharmony_ci    description: Changed from `--diagnostic-report-directory` to
11141cb0ef41Sopenharmony_ci                 `--report-directory`.
11151cb0ef41Sopenharmony_ci-->
11161cb0ef41Sopenharmony_ci
11171cb0ef41Sopenharmony_ciLocation at which the report will be generated.
11181cb0ef41Sopenharmony_ci
11191cb0ef41Sopenharmony_ci### `--report-filename=filename`
11201cb0ef41Sopenharmony_ci
11211cb0ef41Sopenharmony_ci<!-- YAML
11221cb0ef41Sopenharmony_ciadded: v11.8.0
11231cb0ef41Sopenharmony_cichanges:
11241cb0ef41Sopenharmony_ci  - version:
11251cb0ef41Sopenharmony_ci     - v13.12.0
11261cb0ef41Sopenharmony_ci     - v12.17.0
11271cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/32242
11281cb0ef41Sopenharmony_ci    description: This option is no longer experimental.
11291cb0ef41Sopenharmony_ci  - version: v12.0.0
11301cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/27312
11311cb0ef41Sopenharmony_ci    description: changed from `--diagnostic-report-filename` to
11321cb0ef41Sopenharmony_ci                 `--report-filename`.
11331cb0ef41Sopenharmony_ci-->
11341cb0ef41Sopenharmony_ci
11351cb0ef41Sopenharmony_ciName of the file to which the report will be written.
11361cb0ef41Sopenharmony_ci
11371cb0ef41Sopenharmony_ciIf the filename is set to `'stdout'` or `'stderr'`, the report is written to
11381cb0ef41Sopenharmony_cithe stdout or stderr of the process respectively.
11391cb0ef41Sopenharmony_ci
11401cb0ef41Sopenharmony_ci### `--report-on-fatalerror`
11411cb0ef41Sopenharmony_ci
11421cb0ef41Sopenharmony_ci<!-- YAML
11431cb0ef41Sopenharmony_ciadded: v11.8.0
11441cb0ef41Sopenharmony_cichanges:
11451cb0ef41Sopenharmony_ci  - version:
11461cb0ef41Sopenharmony_ci    - v14.0.0
11471cb0ef41Sopenharmony_ci    - v13.14.0
11481cb0ef41Sopenharmony_ci    - v12.17.0
11491cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/32496
11501cb0ef41Sopenharmony_ci    description: This option is no longer experimental.
11511cb0ef41Sopenharmony_ci  - version: v12.0.0
11521cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/27312
11531cb0ef41Sopenharmony_ci    description: changed from `--diagnostic-report-on-fatalerror` to
11541cb0ef41Sopenharmony_ci                 `--report-on-fatalerror`.
11551cb0ef41Sopenharmony_ci-->
11561cb0ef41Sopenharmony_ci
11571cb0ef41Sopenharmony_ciEnables the report to be triggered on fatal errors (internal errors within
11581cb0ef41Sopenharmony_cithe Node.js runtime such as out of memory) that lead to termination of the
11591cb0ef41Sopenharmony_ciapplication. Useful to inspect various diagnostic data elements such as heap,
11601cb0ef41Sopenharmony_cistack, event loop state, resource consumption etc. to reason about the fatal
11611cb0ef41Sopenharmony_cierror.
11621cb0ef41Sopenharmony_ci
11631cb0ef41Sopenharmony_ci### `--report-on-signal`
11641cb0ef41Sopenharmony_ci
11651cb0ef41Sopenharmony_ci<!-- YAML
11661cb0ef41Sopenharmony_ciadded: v11.8.0
11671cb0ef41Sopenharmony_cichanges:
11681cb0ef41Sopenharmony_ci  - version:
11691cb0ef41Sopenharmony_ci     - v13.12.0
11701cb0ef41Sopenharmony_ci     - v12.17.0
11711cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/32242
11721cb0ef41Sopenharmony_ci    description: This option is no longer experimental.
11731cb0ef41Sopenharmony_ci  - version: v12.0.0
11741cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/27312
11751cb0ef41Sopenharmony_ci    description: changed from `--diagnostic-report-on-signal` to
11761cb0ef41Sopenharmony_ci                 `--report-on-signal`.
11771cb0ef41Sopenharmony_ci-->
11781cb0ef41Sopenharmony_ci
11791cb0ef41Sopenharmony_ciEnables report to be generated upon receiving the specified (or predefined)
11801cb0ef41Sopenharmony_cisignal to the running Node.js process. The signal to trigger the report is
11811cb0ef41Sopenharmony_cispecified through `--report-signal`.
11821cb0ef41Sopenharmony_ci
11831cb0ef41Sopenharmony_ci### `--report-signal=signal`
11841cb0ef41Sopenharmony_ci
11851cb0ef41Sopenharmony_ci<!-- YAML
11861cb0ef41Sopenharmony_ciadded: v11.8.0
11871cb0ef41Sopenharmony_cichanges:
11881cb0ef41Sopenharmony_ci  - version:
11891cb0ef41Sopenharmony_ci     - v13.12.0
11901cb0ef41Sopenharmony_ci     - v12.17.0
11911cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/32242
11921cb0ef41Sopenharmony_ci    description: This option is no longer experimental.
11931cb0ef41Sopenharmony_ci  - version: v12.0.0
11941cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/27312
11951cb0ef41Sopenharmony_ci    description: changed from `--diagnostic-report-signal` to
11961cb0ef41Sopenharmony_ci                 `--report-signal`.
11971cb0ef41Sopenharmony_ci-->
11981cb0ef41Sopenharmony_ci
11991cb0ef41Sopenharmony_ciSets or resets the signal for report generation (not supported on Windows).
12001cb0ef41Sopenharmony_ciDefault signal is `SIGUSR2`.
12011cb0ef41Sopenharmony_ci
12021cb0ef41Sopenharmony_ci### `--report-uncaught-exception`
12031cb0ef41Sopenharmony_ci
12041cb0ef41Sopenharmony_ci<!-- YAML
12051cb0ef41Sopenharmony_ciadded: v11.8.0
12061cb0ef41Sopenharmony_cichanges:
12071cb0ef41Sopenharmony_ci  - version: v18.8.0
12081cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/44208
12091cb0ef41Sopenharmony_ci    description: Report is not generated if the uncaught exception is handled.
12101cb0ef41Sopenharmony_ci  - version:
12111cb0ef41Sopenharmony_ci     - v13.12.0
12121cb0ef41Sopenharmony_ci     - v12.17.0
12131cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/32242
12141cb0ef41Sopenharmony_ci    description: This option is no longer experimental.
12151cb0ef41Sopenharmony_ci  - version: v12.0.0
12161cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/27312
12171cb0ef41Sopenharmony_ci    description: changed from `--diagnostic-report-uncaught-exception` to
12181cb0ef41Sopenharmony_ci                 `--report-uncaught-exception`.
12191cb0ef41Sopenharmony_ci-->
12201cb0ef41Sopenharmony_ci
12211cb0ef41Sopenharmony_ciEnables report to be generated when the process exits due to an uncaught
12221cb0ef41Sopenharmony_ciexception. Useful when inspecting the JavaScript stack in conjunction with
12231cb0ef41Sopenharmony_cinative stack and other runtime environment data.
12241cb0ef41Sopenharmony_ci
12251cb0ef41Sopenharmony_ci### `--secure-heap=n`
12261cb0ef41Sopenharmony_ci
12271cb0ef41Sopenharmony_ci<!-- YAML
12281cb0ef41Sopenharmony_ciadded: v15.6.0
12291cb0ef41Sopenharmony_ci-->
12301cb0ef41Sopenharmony_ci
12311cb0ef41Sopenharmony_ciInitializes an OpenSSL secure heap of `n` bytes. When initialized, the
12321cb0ef41Sopenharmony_cisecure heap is used for selected types of allocations within OpenSSL
12331cb0ef41Sopenharmony_ciduring key generation and other operations. This is useful, for instance,
12341cb0ef41Sopenharmony_cito prevent sensitive information from leaking due to pointer overruns
12351cb0ef41Sopenharmony_cior underruns.
12361cb0ef41Sopenharmony_ci
12371cb0ef41Sopenharmony_ciThe secure heap is a fixed size and cannot be resized at runtime so,
12381cb0ef41Sopenharmony_ciif used, it is important to select a large enough heap to cover all
12391cb0ef41Sopenharmony_ciapplication uses.
12401cb0ef41Sopenharmony_ci
12411cb0ef41Sopenharmony_ciThe heap size given must be a power of two. Any value less than 2
12421cb0ef41Sopenharmony_ciwill disable the secure heap.
12431cb0ef41Sopenharmony_ci
12441cb0ef41Sopenharmony_ciThe secure heap is disabled by default.
12451cb0ef41Sopenharmony_ci
12461cb0ef41Sopenharmony_ciThe secure heap is not available on Windows.
12471cb0ef41Sopenharmony_ci
12481cb0ef41Sopenharmony_ciSee [`CRYPTO_secure_malloc_init`][] for more details.
12491cb0ef41Sopenharmony_ci
12501cb0ef41Sopenharmony_ci### `--secure-heap-min=n`
12511cb0ef41Sopenharmony_ci
12521cb0ef41Sopenharmony_ci<!-- YAML
12531cb0ef41Sopenharmony_ciadded: v15.6.0
12541cb0ef41Sopenharmony_ci-->
12551cb0ef41Sopenharmony_ci
12561cb0ef41Sopenharmony_ciWhen using `--secure-heap`, the `--secure-heap-min` flag specifies the
12571cb0ef41Sopenharmony_ciminimum allocation from the secure heap. The minimum value is `2`.
12581cb0ef41Sopenharmony_ciThe maximum value is the lesser of `--secure-heap` or `2147483647`.
12591cb0ef41Sopenharmony_ciThe value given must be a power of two.
12601cb0ef41Sopenharmony_ci
12611cb0ef41Sopenharmony_ci### `--snapshot-blob=path`
12621cb0ef41Sopenharmony_ci
12631cb0ef41Sopenharmony_ci<!-- YAML
12641cb0ef41Sopenharmony_ciadded: v18.8.0
12651cb0ef41Sopenharmony_ci-->
12661cb0ef41Sopenharmony_ci
12671cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
12681cb0ef41Sopenharmony_ci
12691cb0ef41Sopenharmony_ciWhen used with `--build-snapshot`, `--snapshot-blob` specifies the path
12701cb0ef41Sopenharmony_ciwhere the generated snapshot blob is written to. If not specified, the
12711cb0ef41Sopenharmony_cigenerated blob is written to `snapshot.blob` in the current working directory.
12721cb0ef41Sopenharmony_ci
12731cb0ef41Sopenharmony_ciWhen used without `--build-snapshot`, `--snapshot-blob` specifies the
12741cb0ef41Sopenharmony_cipath to the blob that is used to restore the application state.
12751cb0ef41Sopenharmony_ci
12761cb0ef41Sopenharmony_ciWhen loading a snapshot, Node.js checks that:
12771cb0ef41Sopenharmony_ci
12781cb0ef41Sopenharmony_ci1. The version, architecture, and platform of the running Node.js binary
12791cb0ef41Sopenharmony_ci   are exactly the same as that of the binary that generates the snapshot.
12801cb0ef41Sopenharmony_ci2. The V8 flags and CPU features are compatible with that of the binary
12811cb0ef41Sopenharmony_ci   that generates the snapshot.
12821cb0ef41Sopenharmony_ci
12831cb0ef41Sopenharmony_ciIf they don't match, Node.js refuses to load the snapshot and exits with
12841cb0ef41Sopenharmony_cistatus code 1.
12851cb0ef41Sopenharmony_ci
12861cb0ef41Sopenharmony_ci### `--test`
12871cb0ef41Sopenharmony_ci
12881cb0ef41Sopenharmony_ci<!-- YAML
12891cb0ef41Sopenharmony_ciadded: v18.1.0
12901cb0ef41Sopenharmony_cichanges:
12911cb0ef41Sopenharmony_ci  - version: v18.13.0
12921cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/45214
12931cb0ef41Sopenharmony_ci    description: Test runner now supports running in watch mode.
12941cb0ef41Sopenharmony_ci-->
12951cb0ef41Sopenharmony_ci
12961cb0ef41Sopenharmony_ciStarts the Node.js command line test runner. This flag cannot be combined with
12971cb0ef41Sopenharmony_ci`--watch-path`, `--check`, `--eval`, `--interactive`, or the inspector.
12981cb0ef41Sopenharmony_ciSee the documentation on [running tests from the command line][]
12991cb0ef41Sopenharmony_cifor more details.
13001cb0ef41Sopenharmony_ci
13011cb0ef41Sopenharmony_ci### `--test-concurrency`
13021cb0ef41Sopenharmony_ci
13031cb0ef41Sopenharmony_ci<!-- YAML
13041cb0ef41Sopenharmony_ciadded: v18.19.0
13051cb0ef41Sopenharmony_ci-->
13061cb0ef41Sopenharmony_ci
13071cb0ef41Sopenharmony_ciThe maximum number of test files that the test runner CLI will execute
13081cb0ef41Sopenharmony_ciconcurrently. The default value is `os.availableParallelism() - 1`.
13091cb0ef41Sopenharmony_ci
13101cb0ef41Sopenharmony_ci### `--test-name-pattern`
13111cb0ef41Sopenharmony_ci
13121cb0ef41Sopenharmony_ci<!-- YAML
13131cb0ef41Sopenharmony_ciadded: v18.11.0
13141cb0ef41Sopenharmony_ci-->
13151cb0ef41Sopenharmony_ci
13161cb0ef41Sopenharmony_ciA regular expression that configures the test runner to only execute tests
13171cb0ef41Sopenharmony_ciwhose name matches the provided pattern. See the documentation on
13181cb0ef41Sopenharmony_ci[filtering tests by name][] for more details.
13191cb0ef41Sopenharmony_ci
13201cb0ef41Sopenharmony_ci### `--test-reporter`
13211cb0ef41Sopenharmony_ci
13221cb0ef41Sopenharmony_ci<!-- YAML
13231cb0ef41Sopenharmony_ciadded: v18.15.0
13241cb0ef41Sopenharmony_ci-->
13251cb0ef41Sopenharmony_ci
13261cb0ef41Sopenharmony_ciA test reporter to use when running tests. See the documentation on
13271cb0ef41Sopenharmony_ci[test reporters][] for more details.
13281cb0ef41Sopenharmony_ci
13291cb0ef41Sopenharmony_ci### `--test-reporter-destination`
13301cb0ef41Sopenharmony_ci
13311cb0ef41Sopenharmony_ci<!-- YAML
13321cb0ef41Sopenharmony_ciadded: v18.15.0
13331cb0ef41Sopenharmony_ci-->
13341cb0ef41Sopenharmony_ci
13351cb0ef41Sopenharmony_ciThe destination for the corresponding test reporter. See the documentation on
13361cb0ef41Sopenharmony_ci[test reporters][] for more details.
13371cb0ef41Sopenharmony_ci
13381cb0ef41Sopenharmony_ci### `--test-only`
13391cb0ef41Sopenharmony_ci
13401cb0ef41Sopenharmony_ci<!-- YAML
13411cb0ef41Sopenharmony_ciadded: v18.0.0
13421cb0ef41Sopenharmony_ci-->
13431cb0ef41Sopenharmony_ci
13441cb0ef41Sopenharmony_ciConfigures the test runner to only execute top level tests that have the `only`
13451cb0ef41Sopenharmony_cioption set.
13461cb0ef41Sopenharmony_ci
13471cb0ef41Sopenharmony_ci### `--test-shard`
13481cb0ef41Sopenharmony_ci
13491cb0ef41Sopenharmony_ci<!-- YAML
13501cb0ef41Sopenharmony_ciadded: v18.19.0
13511cb0ef41Sopenharmony_ci-->
13521cb0ef41Sopenharmony_ci
13531cb0ef41Sopenharmony_ciTest suite shard to execute in a format of `<index>/<total>`, where
13541cb0ef41Sopenharmony_ci
13551cb0ef41Sopenharmony_ci`index` is a positive integer, index of divided parts
13561cb0ef41Sopenharmony_ci`total` is a positive integer, total of divided part
13571cb0ef41Sopenharmony_ciThis command will divide all tests files into `total` equal parts,
13581cb0ef41Sopenharmony_ciand will run only those that happen to be in an `index` part.
13591cb0ef41Sopenharmony_ci
13601cb0ef41Sopenharmony_ciFor example, to split your tests suite into three parts, use this:
13611cb0ef41Sopenharmony_ci
13621cb0ef41Sopenharmony_ci```bash
13631cb0ef41Sopenharmony_cinode --test --test-shard=1/3
13641cb0ef41Sopenharmony_cinode --test --test-shard=2/3
13651cb0ef41Sopenharmony_cinode --test --test-shard=3/3
13661cb0ef41Sopenharmony_ci```
13671cb0ef41Sopenharmony_ci
13681cb0ef41Sopenharmony_ci### `--throw-deprecation`
13691cb0ef41Sopenharmony_ci
13701cb0ef41Sopenharmony_ci<!-- YAML
13711cb0ef41Sopenharmony_ciadded: v0.11.14
13721cb0ef41Sopenharmony_ci-->
13731cb0ef41Sopenharmony_ci
13741cb0ef41Sopenharmony_ciThrow errors for deprecations.
13751cb0ef41Sopenharmony_ci
13761cb0ef41Sopenharmony_ci### `--title=title`
13771cb0ef41Sopenharmony_ci
13781cb0ef41Sopenharmony_ci<!-- YAML
13791cb0ef41Sopenharmony_ciadded: v10.7.0
13801cb0ef41Sopenharmony_ci-->
13811cb0ef41Sopenharmony_ci
13821cb0ef41Sopenharmony_ciSet `process.title` on startup.
13831cb0ef41Sopenharmony_ci
13841cb0ef41Sopenharmony_ci### `--tls-cipher-list=list`
13851cb0ef41Sopenharmony_ci
13861cb0ef41Sopenharmony_ci<!-- YAML
13871cb0ef41Sopenharmony_ciadded: v4.0.0
13881cb0ef41Sopenharmony_ci-->
13891cb0ef41Sopenharmony_ci
13901cb0ef41Sopenharmony_ciSpecify an alternative default TLS cipher list. Requires Node.js to be built
13911cb0ef41Sopenharmony_ciwith crypto support (default).
13921cb0ef41Sopenharmony_ci
13931cb0ef41Sopenharmony_ci### `--tls-keylog=file`
13941cb0ef41Sopenharmony_ci
13951cb0ef41Sopenharmony_ci<!-- YAML
13961cb0ef41Sopenharmony_ciadded:
13971cb0ef41Sopenharmony_ci - v13.2.0
13981cb0ef41Sopenharmony_ci - v12.16.0
13991cb0ef41Sopenharmony_ci-->
14001cb0ef41Sopenharmony_ci
14011cb0ef41Sopenharmony_ciLog TLS key material to a file. The key material is in NSS `SSLKEYLOGFILE`
14021cb0ef41Sopenharmony_ciformat and can be used by software (such as Wireshark) to decrypt the TLS
14031cb0ef41Sopenharmony_citraffic.
14041cb0ef41Sopenharmony_ci
14051cb0ef41Sopenharmony_ci### `--tls-max-v1.2`
14061cb0ef41Sopenharmony_ci
14071cb0ef41Sopenharmony_ci<!-- YAML
14081cb0ef41Sopenharmony_ciadded:
14091cb0ef41Sopenharmony_ci - v12.0.0
14101cb0ef41Sopenharmony_ci - v10.20.0
14111cb0ef41Sopenharmony_ci-->
14121cb0ef41Sopenharmony_ci
14131cb0ef41Sopenharmony_ciSet [`tls.DEFAULT_MAX_VERSION`][] to 'TLSv1.2'. Use to disable support for
14141cb0ef41Sopenharmony_ciTLSv1.3.
14151cb0ef41Sopenharmony_ci
14161cb0ef41Sopenharmony_ci### `--tls-max-v1.3`
14171cb0ef41Sopenharmony_ci
14181cb0ef41Sopenharmony_ci<!-- YAML
14191cb0ef41Sopenharmony_ciadded: v12.0.0
14201cb0ef41Sopenharmony_ci-->
14211cb0ef41Sopenharmony_ci
14221cb0ef41Sopenharmony_ciSet default [`tls.DEFAULT_MAX_VERSION`][] to 'TLSv1.3'. Use to enable support
14231cb0ef41Sopenharmony_cifor TLSv1.3.
14241cb0ef41Sopenharmony_ci
14251cb0ef41Sopenharmony_ci### `--tls-min-v1.0`
14261cb0ef41Sopenharmony_ci
14271cb0ef41Sopenharmony_ci<!-- YAML
14281cb0ef41Sopenharmony_ciadded:
14291cb0ef41Sopenharmony_ci - v12.0.0
14301cb0ef41Sopenharmony_ci - v10.20.0
14311cb0ef41Sopenharmony_ci-->
14321cb0ef41Sopenharmony_ci
14331cb0ef41Sopenharmony_ciSet default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1'. Use for compatibility with
14341cb0ef41Sopenharmony_ciold TLS clients or servers.
14351cb0ef41Sopenharmony_ci
14361cb0ef41Sopenharmony_ci### `--tls-min-v1.1`
14371cb0ef41Sopenharmony_ci
14381cb0ef41Sopenharmony_ci<!-- YAML
14391cb0ef41Sopenharmony_ciadded:
14401cb0ef41Sopenharmony_ci - v12.0.0
14411cb0ef41Sopenharmony_ci - v10.20.0
14421cb0ef41Sopenharmony_ci-->
14431cb0ef41Sopenharmony_ci
14441cb0ef41Sopenharmony_ciSet default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.1'. Use for compatibility
14451cb0ef41Sopenharmony_ciwith old TLS clients or servers.
14461cb0ef41Sopenharmony_ci
14471cb0ef41Sopenharmony_ci### `--tls-min-v1.2`
14481cb0ef41Sopenharmony_ci
14491cb0ef41Sopenharmony_ci<!-- YAML
14501cb0ef41Sopenharmony_ciadded:
14511cb0ef41Sopenharmony_ci - v12.2.0
14521cb0ef41Sopenharmony_ci - v10.20.0
14531cb0ef41Sopenharmony_ci-->
14541cb0ef41Sopenharmony_ci
14551cb0ef41Sopenharmony_ciSet default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.2'. This is the default for
14561cb0ef41Sopenharmony_ci12.x and later, but the option is supported for compatibility with older Node.js
14571cb0ef41Sopenharmony_civersions.
14581cb0ef41Sopenharmony_ci
14591cb0ef41Sopenharmony_ci### `--tls-min-v1.3`
14601cb0ef41Sopenharmony_ci
14611cb0ef41Sopenharmony_ci<!-- YAML
14621cb0ef41Sopenharmony_ciadded: v12.0.0
14631cb0ef41Sopenharmony_ci-->
14641cb0ef41Sopenharmony_ci
14651cb0ef41Sopenharmony_ciSet default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support
14661cb0ef41Sopenharmony_cifor TLSv1.2, which is not as secure as TLSv1.3.
14671cb0ef41Sopenharmony_ci
14681cb0ef41Sopenharmony_ci### `--trace-atomics-wait`
14691cb0ef41Sopenharmony_ci
14701cb0ef41Sopenharmony_ci<!-- YAML
14711cb0ef41Sopenharmony_ciadded: v14.3.0
14721cb0ef41Sopenharmony_cideprecated: v18.8.0
14731cb0ef41Sopenharmony_ci-->
14741cb0ef41Sopenharmony_ci
14751cb0ef41Sopenharmony_ci> Stability: 0 - Deprecated
14761cb0ef41Sopenharmony_ci
14771cb0ef41Sopenharmony_ciPrint short summaries of calls to [`Atomics.wait()`][] to stderr.
14781cb0ef41Sopenharmony_ciThe output could look like this:
14791cb0ef41Sopenharmony_ci
14801cb0ef41Sopenharmony_ci```text
14811cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf) started
14821cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf) did not wait because the values mismatched
14831cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 0, 10) started
14841cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 0, 10) timed out
14851cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 4, 0, inf) started
14861cb0ef41Sopenharmony_ci(node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) started
14871cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 4, 0, inf) was woken up by another thread
14881cb0ef41Sopenharmony_ci(node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) was woken up by another thread
14891cb0ef41Sopenharmony_ci```
14901cb0ef41Sopenharmony_ci
14911cb0ef41Sopenharmony_ciThe fields here correspond to:
14921cb0ef41Sopenharmony_ci
14931cb0ef41Sopenharmony_ci* The thread id as given by [`worker_threads.threadId`][]
14941cb0ef41Sopenharmony_ci* The base address of the `SharedArrayBuffer` in question, as well as the
14951cb0ef41Sopenharmony_ci  byte offset corresponding to the index passed to `Atomics.wait()`
14961cb0ef41Sopenharmony_ci* The expected value that was passed to `Atomics.wait()`
14971cb0ef41Sopenharmony_ci* The timeout passed to `Atomics.wait`
14981cb0ef41Sopenharmony_ci
14991cb0ef41Sopenharmony_ci### `--trace-deprecation`
15001cb0ef41Sopenharmony_ci
15011cb0ef41Sopenharmony_ci<!-- YAML
15021cb0ef41Sopenharmony_ciadded: v0.8.0
15031cb0ef41Sopenharmony_ci-->
15041cb0ef41Sopenharmony_ci
15051cb0ef41Sopenharmony_ciPrint stack traces for deprecations.
15061cb0ef41Sopenharmony_ci
15071cb0ef41Sopenharmony_ci### `--trace-event-categories`
15081cb0ef41Sopenharmony_ci
15091cb0ef41Sopenharmony_ci<!-- YAML
15101cb0ef41Sopenharmony_ciadded: v7.7.0
15111cb0ef41Sopenharmony_ci-->
15121cb0ef41Sopenharmony_ci
15131cb0ef41Sopenharmony_ciA comma separated list of categories that should be traced when trace event
15141cb0ef41Sopenharmony_citracing is enabled using `--trace-events-enabled`.
15151cb0ef41Sopenharmony_ci
15161cb0ef41Sopenharmony_ci### `--trace-event-file-pattern`
15171cb0ef41Sopenharmony_ci
15181cb0ef41Sopenharmony_ci<!-- YAML
15191cb0ef41Sopenharmony_ciadded: v9.8.0
15201cb0ef41Sopenharmony_ci-->
15211cb0ef41Sopenharmony_ci
15221cb0ef41Sopenharmony_ciTemplate string specifying the filepath for the trace event data, it
15231cb0ef41Sopenharmony_cisupports `${rotation}` and `${pid}`.
15241cb0ef41Sopenharmony_ci
15251cb0ef41Sopenharmony_ci### `--trace-events-enabled`
15261cb0ef41Sopenharmony_ci
15271cb0ef41Sopenharmony_ci<!-- YAML
15281cb0ef41Sopenharmony_ciadded: v7.7.0
15291cb0ef41Sopenharmony_ci-->
15301cb0ef41Sopenharmony_ci
15311cb0ef41Sopenharmony_ciEnables the collection of trace event tracing information.
15321cb0ef41Sopenharmony_ci
15331cb0ef41Sopenharmony_ci### `--trace-exit`
15341cb0ef41Sopenharmony_ci
15351cb0ef41Sopenharmony_ci<!-- YAML
15361cb0ef41Sopenharmony_ciadded:
15371cb0ef41Sopenharmony_ci - v13.5.0
15381cb0ef41Sopenharmony_ci - v12.16.0
15391cb0ef41Sopenharmony_ci-->
15401cb0ef41Sopenharmony_ci
15411cb0ef41Sopenharmony_ciPrints a stack trace whenever an environment is exited proactively,
15421cb0ef41Sopenharmony_cii.e. invoking `process.exit()`.
15431cb0ef41Sopenharmony_ci
15441cb0ef41Sopenharmony_ci### `--trace-sigint`
15451cb0ef41Sopenharmony_ci
15461cb0ef41Sopenharmony_ci<!-- YAML
15471cb0ef41Sopenharmony_ciadded:
15481cb0ef41Sopenharmony_ci - v13.9.0
15491cb0ef41Sopenharmony_ci - v12.17.0
15501cb0ef41Sopenharmony_ci-->
15511cb0ef41Sopenharmony_ci
15521cb0ef41Sopenharmony_ciPrints a stack trace on SIGINT.
15531cb0ef41Sopenharmony_ci
15541cb0ef41Sopenharmony_ci### `--trace-sync-io`
15551cb0ef41Sopenharmony_ci
15561cb0ef41Sopenharmony_ci<!-- YAML
15571cb0ef41Sopenharmony_ciadded: v2.1.0
15581cb0ef41Sopenharmony_ci-->
15591cb0ef41Sopenharmony_ci
15601cb0ef41Sopenharmony_ciPrints a stack trace whenever synchronous I/O is detected after the first turn
15611cb0ef41Sopenharmony_ciof the event loop.
15621cb0ef41Sopenharmony_ci
15631cb0ef41Sopenharmony_ci### `--trace-tls`
15641cb0ef41Sopenharmony_ci
15651cb0ef41Sopenharmony_ci<!-- YAML
15661cb0ef41Sopenharmony_ciadded: v12.2.0
15671cb0ef41Sopenharmony_ci-->
15681cb0ef41Sopenharmony_ci
15691cb0ef41Sopenharmony_ciPrints TLS packet trace information to `stderr`. This can be used to debug TLS
15701cb0ef41Sopenharmony_ciconnection problems.
15711cb0ef41Sopenharmony_ci
15721cb0ef41Sopenharmony_ci### `--trace-uncaught`
15731cb0ef41Sopenharmony_ci
15741cb0ef41Sopenharmony_ci<!-- YAML
15751cb0ef41Sopenharmony_ciadded: v13.1.0
15761cb0ef41Sopenharmony_ci-->
15771cb0ef41Sopenharmony_ci
15781cb0ef41Sopenharmony_ciPrint stack traces for uncaught exceptions; usually, the stack trace associated
15791cb0ef41Sopenharmony_ciwith the creation of an `Error` is printed, whereas this makes Node.js also
15801cb0ef41Sopenharmony_ciprint the stack trace associated with throwing the value (which does not need
15811cb0ef41Sopenharmony_cito be an `Error` instance).
15821cb0ef41Sopenharmony_ci
15831cb0ef41Sopenharmony_ciEnabling this option may affect garbage collection behavior negatively.
15841cb0ef41Sopenharmony_ci
15851cb0ef41Sopenharmony_ci### `--trace-warnings`
15861cb0ef41Sopenharmony_ci
15871cb0ef41Sopenharmony_ci<!-- YAML
15881cb0ef41Sopenharmony_ciadded: v6.0.0
15891cb0ef41Sopenharmony_ci-->
15901cb0ef41Sopenharmony_ci
15911cb0ef41Sopenharmony_ciPrint stack traces for process warnings (including deprecations).
15921cb0ef41Sopenharmony_ci
15931cb0ef41Sopenharmony_ci### `--track-heap-objects`
15941cb0ef41Sopenharmony_ci
15951cb0ef41Sopenharmony_ci<!-- YAML
15961cb0ef41Sopenharmony_ciadded: v2.4.0
15971cb0ef41Sopenharmony_ci-->
15981cb0ef41Sopenharmony_ci
15991cb0ef41Sopenharmony_ciTrack heap object allocations for heap snapshots.
16001cb0ef41Sopenharmony_ci
16011cb0ef41Sopenharmony_ci### `--unhandled-rejections=mode`
16021cb0ef41Sopenharmony_ci
16031cb0ef41Sopenharmony_ci<!-- YAML
16041cb0ef41Sopenharmony_ciadded:
16051cb0ef41Sopenharmony_ci  - v12.0.0
16061cb0ef41Sopenharmony_ci  - v10.17.0
16071cb0ef41Sopenharmony_cichanges:
16081cb0ef41Sopenharmony_ci  - version: v15.0.0
16091cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/33021
16101cb0ef41Sopenharmony_ci    description: Changed default mode to `throw`. Previously, a warning was
16111cb0ef41Sopenharmony_ci                 emitted.
16121cb0ef41Sopenharmony_ci-->
16131cb0ef41Sopenharmony_ci
16141cb0ef41Sopenharmony_ciUsing this flag allows to change what should happen when an unhandled rejection
16151cb0ef41Sopenharmony_cioccurs. One of the following modes can be chosen:
16161cb0ef41Sopenharmony_ci
16171cb0ef41Sopenharmony_ci* `throw`: Emit [`unhandledRejection`][]. If this hook is not set, raise the
16181cb0ef41Sopenharmony_ci  unhandled rejection as an uncaught exception. This is the default.
16191cb0ef41Sopenharmony_ci* `strict`: Raise the unhandled rejection as an uncaught exception. If the
16201cb0ef41Sopenharmony_ci  exception is handled, [`unhandledRejection`][] is emitted.
16211cb0ef41Sopenharmony_ci* `warn`: Always trigger a warning, no matter if the [`unhandledRejection`][]
16221cb0ef41Sopenharmony_ci  hook is set or not but do not print the deprecation warning.
16231cb0ef41Sopenharmony_ci* `warn-with-error-code`: Emit [`unhandledRejection`][]. If this hook is not
16241cb0ef41Sopenharmony_ci  set, trigger a warning, and set the process exit code to 1.
16251cb0ef41Sopenharmony_ci* `none`: Silence all warnings.
16261cb0ef41Sopenharmony_ci
16271cb0ef41Sopenharmony_ciIf a rejection happens during the command line entry point's ES module static
16281cb0ef41Sopenharmony_ciloading phase, it will always raise it as an uncaught exception.
16291cb0ef41Sopenharmony_ci
16301cb0ef41Sopenharmony_ci### `--use-bundled-ca`, `--use-openssl-ca`
16311cb0ef41Sopenharmony_ci
16321cb0ef41Sopenharmony_ci<!-- YAML
16331cb0ef41Sopenharmony_ciadded: v6.11.0
16341cb0ef41Sopenharmony_ci-->
16351cb0ef41Sopenharmony_ci
16361cb0ef41Sopenharmony_ciUse bundled Mozilla CA store as supplied by current Node.js version
16371cb0ef41Sopenharmony_cior use OpenSSL's default CA store. The default store is selectable
16381cb0ef41Sopenharmony_ciat build-time.
16391cb0ef41Sopenharmony_ci
16401cb0ef41Sopenharmony_ciThe bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store
16411cb0ef41Sopenharmony_cithat is fixed at release time. It is identical on all supported platforms.
16421cb0ef41Sopenharmony_ci
16431cb0ef41Sopenharmony_ciUsing OpenSSL store allows for external modifications of the store. For most
16441cb0ef41Sopenharmony_ciLinux and BSD distributions, this store is maintained by the distribution
16451cb0ef41Sopenharmony_cimaintainers and system administrators. OpenSSL CA store location is dependent on
16461cb0ef41Sopenharmony_ciconfiguration of the OpenSSL library but this can be altered at runtime using
16471cb0ef41Sopenharmony_cienvironment variables.
16481cb0ef41Sopenharmony_ci
16491cb0ef41Sopenharmony_ciSee `SSL_CERT_DIR` and `SSL_CERT_FILE`.
16501cb0ef41Sopenharmony_ci
16511cb0ef41Sopenharmony_ci### `--use-largepages=mode`
16521cb0ef41Sopenharmony_ci
16531cb0ef41Sopenharmony_ci<!-- YAML
16541cb0ef41Sopenharmony_ciadded:
16551cb0ef41Sopenharmony_ci - v13.6.0
16561cb0ef41Sopenharmony_ci - v12.17.0
16571cb0ef41Sopenharmony_ci-->
16581cb0ef41Sopenharmony_ci
16591cb0ef41Sopenharmony_ciRe-map the Node.js static code to large memory pages at startup. If supported on
16601cb0ef41Sopenharmony_cithe target system, this will cause the Node.js static code to be moved onto 2
16611cb0ef41Sopenharmony_ciMiB pages instead of 4 KiB pages.
16621cb0ef41Sopenharmony_ci
16631cb0ef41Sopenharmony_ciThe following values are valid for `mode`:
16641cb0ef41Sopenharmony_ci
16651cb0ef41Sopenharmony_ci* `off`: No mapping will be attempted. This is the default.
16661cb0ef41Sopenharmony_ci* `on`: If supported by the OS, mapping will be attempted. Failure to map will
16671cb0ef41Sopenharmony_ci  be ignored and a message will be printed to standard error.
16681cb0ef41Sopenharmony_ci* `silent`: If supported by the OS, mapping will be attempted. Failure to map
16691cb0ef41Sopenharmony_ci  will be ignored and will not be reported.
16701cb0ef41Sopenharmony_ci
16711cb0ef41Sopenharmony_ci### `--v8-options`
16721cb0ef41Sopenharmony_ci
16731cb0ef41Sopenharmony_ci<!-- YAML
16741cb0ef41Sopenharmony_ciadded: v0.1.3
16751cb0ef41Sopenharmony_ci-->
16761cb0ef41Sopenharmony_ci
16771cb0ef41Sopenharmony_ciPrint V8 command-line options.
16781cb0ef41Sopenharmony_ci
16791cb0ef41Sopenharmony_ci### `--v8-pool-size=num`
16801cb0ef41Sopenharmony_ci
16811cb0ef41Sopenharmony_ci<!-- YAML
16821cb0ef41Sopenharmony_ciadded: v5.10.0
16831cb0ef41Sopenharmony_ci-->
16841cb0ef41Sopenharmony_ci
16851cb0ef41Sopenharmony_ciSet V8's thread pool size which will be used to allocate background jobs.
16861cb0ef41Sopenharmony_ci
16871cb0ef41Sopenharmony_ciIf set to `0` then Node.js will choose an appropriate size of the thread pool
16881cb0ef41Sopenharmony_cibased on an estimate of the amount of parallelism.
16891cb0ef41Sopenharmony_ci
16901cb0ef41Sopenharmony_ciThe amount of parallelism refers to the number of computations that can be
16911cb0ef41Sopenharmony_cicarried out simultaneously in a given machine. In general, it's the same as the
16921cb0ef41Sopenharmony_ciamount of CPUs, but it may diverge in environments such as VMs or containers.
16931cb0ef41Sopenharmony_ci
16941cb0ef41Sopenharmony_ci### `--watch`
16951cb0ef41Sopenharmony_ci
16961cb0ef41Sopenharmony_ci<!-- YAML
16971cb0ef41Sopenharmony_ciadded: v18.11.0
16981cb0ef41Sopenharmony_cichanges:
16991cb0ef41Sopenharmony_ci  - version: v18.13.0
17001cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/45214
17011cb0ef41Sopenharmony_ci    description: Test runner now supports running in watch mode.
17021cb0ef41Sopenharmony_ci-->
17031cb0ef41Sopenharmony_ci
17041cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
17051cb0ef41Sopenharmony_ci
17061cb0ef41Sopenharmony_ciStarts Node.js in watch mode.
17071cb0ef41Sopenharmony_ciWhen in watch mode, changes in the watched files cause the Node.js process to
17081cb0ef41Sopenharmony_cirestart.
17091cb0ef41Sopenharmony_ciBy default, watch mode will watch the entry point
17101cb0ef41Sopenharmony_ciand any required or imported module.
17111cb0ef41Sopenharmony_ciUse `--watch-path` to specify what paths to watch.
17121cb0ef41Sopenharmony_ci
17131cb0ef41Sopenharmony_ciThis flag cannot be combined with
17141cb0ef41Sopenharmony_ci`--check`, `--eval`, `--interactive`, or the REPL.
17151cb0ef41Sopenharmony_ci
17161cb0ef41Sopenharmony_ci```console
17171cb0ef41Sopenharmony_ci$ node --watch index.js
17181cb0ef41Sopenharmony_ci```
17191cb0ef41Sopenharmony_ci
17201cb0ef41Sopenharmony_ci### `--watch-path`
17211cb0ef41Sopenharmony_ci
17221cb0ef41Sopenharmony_ci<!-- YAML
17231cb0ef41Sopenharmony_ciadded: v18.11.0
17241cb0ef41Sopenharmony_ci-->
17251cb0ef41Sopenharmony_ci
17261cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
17271cb0ef41Sopenharmony_ci
17281cb0ef41Sopenharmony_ciStarts Node.js in watch mode and specifies what paths to watch.
17291cb0ef41Sopenharmony_ciWhen in watch mode, changes in the watched paths cause the Node.js process to
17301cb0ef41Sopenharmony_cirestart.
17311cb0ef41Sopenharmony_ciThis will turn off watching of required or imported modules, even when used in
17321cb0ef41Sopenharmony_cicombination with `--watch`.
17331cb0ef41Sopenharmony_ci
17341cb0ef41Sopenharmony_ciThis flag cannot be combined with
17351cb0ef41Sopenharmony_ci`--check`, `--eval`, `--interactive`, `--test`, or the REPL.
17361cb0ef41Sopenharmony_ci
17371cb0ef41Sopenharmony_ci```console
17381cb0ef41Sopenharmony_ci$ node --watch-path=./src --watch-path=./tests index.js
17391cb0ef41Sopenharmony_ci```
17401cb0ef41Sopenharmony_ci
17411cb0ef41Sopenharmony_ciThis option is only supported on macOS and Windows.
17421cb0ef41Sopenharmony_ciAn `ERR_FEATURE_UNAVAILABLE_ON_PLATFORM` exception will be thrown
17431cb0ef41Sopenharmony_ciwhen the option is used on a platform that does not support it.
17441cb0ef41Sopenharmony_ci
17451cb0ef41Sopenharmony_ci### `--watch-preserve-output`
17461cb0ef41Sopenharmony_ci
17471cb0ef41Sopenharmony_ciDisable the clearing of the console when watch mode restarts the process.
17481cb0ef41Sopenharmony_ci
17491cb0ef41Sopenharmony_ci```console
17501cb0ef41Sopenharmony_ci$ node --watch --watch-preserve-output test.js
17511cb0ef41Sopenharmony_ci```
17521cb0ef41Sopenharmony_ci
17531cb0ef41Sopenharmony_ci### `--zero-fill-buffers`
17541cb0ef41Sopenharmony_ci
17551cb0ef41Sopenharmony_ci<!-- YAML
17561cb0ef41Sopenharmony_ciadded: v6.0.0
17571cb0ef41Sopenharmony_ci-->
17581cb0ef41Sopenharmony_ci
17591cb0ef41Sopenharmony_ciAutomatically zero-fills all newly allocated [`Buffer`][] and [`SlowBuffer`][]
17601cb0ef41Sopenharmony_ciinstances.
17611cb0ef41Sopenharmony_ci
17621cb0ef41Sopenharmony_ci### `-c`, `--check`
17631cb0ef41Sopenharmony_ci
17641cb0ef41Sopenharmony_ci<!-- YAML
17651cb0ef41Sopenharmony_ciadded:
17661cb0ef41Sopenharmony_ci  - v5.0.0
17671cb0ef41Sopenharmony_ci  - v4.2.0
17681cb0ef41Sopenharmony_cichanges:
17691cb0ef41Sopenharmony_ci  - version: v10.0.0
17701cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/19600
17711cb0ef41Sopenharmony_ci    description: The `--require` option is now supported when checking a file.
17721cb0ef41Sopenharmony_ci-->
17731cb0ef41Sopenharmony_ci
17741cb0ef41Sopenharmony_ciSyntax check the script without executing.
17751cb0ef41Sopenharmony_ci
17761cb0ef41Sopenharmony_ci### `-e`, `--eval "script"`
17771cb0ef41Sopenharmony_ci
17781cb0ef41Sopenharmony_ci<!-- YAML
17791cb0ef41Sopenharmony_ciadded: v0.5.2
17801cb0ef41Sopenharmony_cichanges:
17811cb0ef41Sopenharmony_ci  - version: v5.11.0
17821cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/5348
17831cb0ef41Sopenharmony_ci    description: Built-in libraries are now available as predefined variables.
17841cb0ef41Sopenharmony_ci-->
17851cb0ef41Sopenharmony_ci
17861cb0ef41Sopenharmony_ciEvaluate the following argument as JavaScript. The modules which are
17871cb0ef41Sopenharmony_cipredefined in the REPL can also be used in `script`.
17881cb0ef41Sopenharmony_ci
17891cb0ef41Sopenharmony_ciOn Windows, using `cmd.exe` a single quote will not work correctly because it
17901cb0ef41Sopenharmony_cionly recognizes double `"` for quoting. In Powershell or Git bash, both `'`
17911cb0ef41Sopenharmony_ciand `"` are usable.
17921cb0ef41Sopenharmony_ci
17931cb0ef41Sopenharmony_ci### `-h`, `--help`
17941cb0ef41Sopenharmony_ci
17951cb0ef41Sopenharmony_ci<!-- YAML
17961cb0ef41Sopenharmony_ciadded: v0.1.3
17971cb0ef41Sopenharmony_ci-->
17981cb0ef41Sopenharmony_ci
17991cb0ef41Sopenharmony_ciPrint node command-line options.
18001cb0ef41Sopenharmony_ciThe output of this option is less detailed than this document.
18011cb0ef41Sopenharmony_ci
18021cb0ef41Sopenharmony_ci### `-i`, `--interactive`
18031cb0ef41Sopenharmony_ci
18041cb0ef41Sopenharmony_ci<!-- YAML
18051cb0ef41Sopenharmony_ciadded: v0.7.7
18061cb0ef41Sopenharmony_ci-->
18071cb0ef41Sopenharmony_ci
18081cb0ef41Sopenharmony_ciOpens the REPL even if stdin does not appear to be a terminal.
18091cb0ef41Sopenharmony_ci
18101cb0ef41Sopenharmony_ci### `-p`, `--print "script"`
18111cb0ef41Sopenharmony_ci
18121cb0ef41Sopenharmony_ci<!-- YAML
18131cb0ef41Sopenharmony_ciadded: v0.6.4
18141cb0ef41Sopenharmony_cichanges:
18151cb0ef41Sopenharmony_ci  - version: v5.11.0
18161cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/5348
18171cb0ef41Sopenharmony_ci    description: Built-in libraries are now available as predefined variables.
18181cb0ef41Sopenharmony_ci-->
18191cb0ef41Sopenharmony_ci
18201cb0ef41Sopenharmony_ciIdentical to `-e` but prints the result.
18211cb0ef41Sopenharmony_ci
18221cb0ef41Sopenharmony_ci### `-r`, `--require module`
18231cb0ef41Sopenharmony_ci
18241cb0ef41Sopenharmony_ci<!-- YAML
18251cb0ef41Sopenharmony_ciadded: v1.6.0
18261cb0ef41Sopenharmony_ci-->
18271cb0ef41Sopenharmony_ci
18281cb0ef41Sopenharmony_ciPreload the specified module at startup.
18291cb0ef41Sopenharmony_ci
18301cb0ef41Sopenharmony_ciFollows `require()`'s module resolution
18311cb0ef41Sopenharmony_cirules. `module` may be either a path to a file, or a node module name.
18321cb0ef41Sopenharmony_ci
18331cb0ef41Sopenharmony_ciOnly CommonJS modules are supported.
18341cb0ef41Sopenharmony_ciUse [`--import`][] to preload an [ECMAScript module][].
18351cb0ef41Sopenharmony_ciModules preloaded with `--require` will run before modules preloaded with `--import`.
18361cb0ef41Sopenharmony_ci
18371cb0ef41Sopenharmony_ci### `-v`, `--version`
18381cb0ef41Sopenharmony_ci
18391cb0ef41Sopenharmony_ci<!-- YAML
18401cb0ef41Sopenharmony_ciadded: v0.1.3
18411cb0ef41Sopenharmony_ci-->
18421cb0ef41Sopenharmony_ci
18431cb0ef41Sopenharmony_ciPrint node's version.
18441cb0ef41Sopenharmony_ci
18451cb0ef41Sopenharmony_ci## Environment variables
18461cb0ef41Sopenharmony_ci
18471cb0ef41Sopenharmony_ci### `FORCE_COLOR=[1, 2, 3]`
18481cb0ef41Sopenharmony_ci
18491cb0ef41Sopenharmony_ciThe `FORCE_COLOR` environment variable is used to
18501cb0ef41Sopenharmony_cienable ANSI colorized output. The value may be:
18511cb0ef41Sopenharmony_ci
18521cb0ef41Sopenharmony_ci* `1`, `true`, or the empty string `''` indicate 16-color support,
18531cb0ef41Sopenharmony_ci* `2` to indicate 256-color support, or
18541cb0ef41Sopenharmony_ci* `3` to indicate 16 million-color support.
18551cb0ef41Sopenharmony_ci
18561cb0ef41Sopenharmony_ciWhen `FORCE_COLOR` is used and set to a supported value, both the `NO_COLOR`,
18571cb0ef41Sopenharmony_ciand `NODE_DISABLE_COLORS` environment variables are ignored.
18581cb0ef41Sopenharmony_ci
18591cb0ef41Sopenharmony_ciAny other value will result in colorized output being disabled.
18601cb0ef41Sopenharmony_ci
18611cb0ef41Sopenharmony_ci### `NODE_DEBUG=module[,…]`
18621cb0ef41Sopenharmony_ci
18631cb0ef41Sopenharmony_ci<!-- YAML
18641cb0ef41Sopenharmony_ciadded: v0.1.32
18651cb0ef41Sopenharmony_ci-->
18661cb0ef41Sopenharmony_ci
18671cb0ef41Sopenharmony_ci`','`-separated list of core modules that should print debug information.
18681cb0ef41Sopenharmony_ci
18691cb0ef41Sopenharmony_ci### `NODE_DEBUG_NATIVE=module[,…]`
18701cb0ef41Sopenharmony_ci
18711cb0ef41Sopenharmony_ci`','`-separated list of core C++ modules that should print debug information.
18721cb0ef41Sopenharmony_ci
18731cb0ef41Sopenharmony_ci### `NODE_DISABLE_COLORS=1`
18741cb0ef41Sopenharmony_ci
18751cb0ef41Sopenharmony_ci<!-- YAML
18761cb0ef41Sopenharmony_ciadded: v0.3.0
18771cb0ef41Sopenharmony_ci-->
18781cb0ef41Sopenharmony_ci
18791cb0ef41Sopenharmony_ciWhen set, colors will not be used in the REPL.
18801cb0ef41Sopenharmony_ci
18811cb0ef41Sopenharmony_ci### `NODE_EXTRA_CA_CERTS=file`
18821cb0ef41Sopenharmony_ci
18831cb0ef41Sopenharmony_ci<!-- YAML
18841cb0ef41Sopenharmony_ciadded: v7.3.0
18851cb0ef41Sopenharmony_ci-->
18861cb0ef41Sopenharmony_ci
18871cb0ef41Sopenharmony_ciWhen set, the well known "root" CAs (like VeriSign) will be extended with the
18881cb0ef41Sopenharmony_ciextra certificates in `file`. The file should consist of one or more trusted
18891cb0ef41Sopenharmony_cicertificates in PEM format. A message will be emitted (once) with
18901cb0ef41Sopenharmony_ci[`process.emitWarning()`][emit_warning] if the file is missing or
18911cb0ef41Sopenharmony_cimalformed, but any errors are otherwise ignored.
18921cb0ef41Sopenharmony_ci
18931cb0ef41Sopenharmony_ciNeither the well known nor extra certificates are used when the `ca`
18941cb0ef41Sopenharmony_cioptions property is explicitly specified for a TLS or HTTPS client or server.
18951cb0ef41Sopenharmony_ci
18961cb0ef41Sopenharmony_ciThis environment variable is ignored when `node` runs as setuid root or
18971cb0ef41Sopenharmony_cihas Linux file capabilities set.
18981cb0ef41Sopenharmony_ci
18991cb0ef41Sopenharmony_ciThe `NODE_EXTRA_CA_CERTS` environment variable is only read when the Node.js
19001cb0ef41Sopenharmony_ciprocess is first launched. Changing the value at runtime using
19011cb0ef41Sopenharmony_ci`process.env.NODE_EXTRA_CA_CERTS` has no effect on the current process.
19021cb0ef41Sopenharmony_ci
19031cb0ef41Sopenharmony_ci### `NODE_ICU_DATA=file`
19041cb0ef41Sopenharmony_ci
19051cb0ef41Sopenharmony_ci<!-- YAML
19061cb0ef41Sopenharmony_ciadded: v0.11.15
19071cb0ef41Sopenharmony_ci-->
19081cb0ef41Sopenharmony_ci
19091cb0ef41Sopenharmony_ciData path for ICU (`Intl` object) data. Will extend linked-in data when compiled
19101cb0ef41Sopenharmony_ciwith small-icu support.
19111cb0ef41Sopenharmony_ci
19121cb0ef41Sopenharmony_ci### `NODE_NO_WARNINGS=1`
19131cb0ef41Sopenharmony_ci
19141cb0ef41Sopenharmony_ci<!-- YAML
19151cb0ef41Sopenharmony_ciadded: v6.11.0
19161cb0ef41Sopenharmony_ci-->
19171cb0ef41Sopenharmony_ci
19181cb0ef41Sopenharmony_ciWhen set to `1`, process warnings are silenced.
19191cb0ef41Sopenharmony_ci
19201cb0ef41Sopenharmony_ci### `NODE_OPTIONS=options...`
19211cb0ef41Sopenharmony_ci
19221cb0ef41Sopenharmony_ci<!-- YAML
19231cb0ef41Sopenharmony_ciadded: v8.0.0
19241cb0ef41Sopenharmony_ci-->
19251cb0ef41Sopenharmony_ci
19261cb0ef41Sopenharmony_ciA space-separated list of command-line options. `options...` are interpreted
19271cb0ef41Sopenharmony_cibefore command-line options, so command-line options will override or
19281cb0ef41Sopenharmony_cicompound after anything in `options...`. Node.js will exit with an error if
19291cb0ef41Sopenharmony_cian option that is not allowed in the environment is used, such as `-p` or a
19301cb0ef41Sopenharmony_ciscript file.
19311cb0ef41Sopenharmony_ci
19321cb0ef41Sopenharmony_ciIf an option value contains a space, it can be escaped using double quotes:
19331cb0ef41Sopenharmony_ci
19341cb0ef41Sopenharmony_ci```bash
19351cb0ef41Sopenharmony_ciNODE_OPTIONS='--require "./my path/file.js"'
19361cb0ef41Sopenharmony_ci```
19371cb0ef41Sopenharmony_ci
19381cb0ef41Sopenharmony_ciA singleton flag passed as a command-line option will override the same flag
19391cb0ef41Sopenharmony_cipassed into `NODE_OPTIONS`:
19401cb0ef41Sopenharmony_ci
19411cb0ef41Sopenharmony_ci```bash
19421cb0ef41Sopenharmony_ci# The inspector will be available on port 5555
19431cb0ef41Sopenharmony_ciNODE_OPTIONS='--inspect=localhost:4444' node --inspect=localhost:5555
19441cb0ef41Sopenharmony_ci```
19451cb0ef41Sopenharmony_ci
19461cb0ef41Sopenharmony_ciA flag that can be passed multiple times will be treated as if its
19471cb0ef41Sopenharmony_ci`NODE_OPTIONS` instances were passed first, and then its command-line
19481cb0ef41Sopenharmony_ciinstances afterwards:
19491cb0ef41Sopenharmony_ci
19501cb0ef41Sopenharmony_ci```bash
19511cb0ef41Sopenharmony_ciNODE_OPTIONS='--require "./a.js"' node --require "./b.js"
19521cb0ef41Sopenharmony_ci# is equivalent to:
19531cb0ef41Sopenharmony_cinode --require "./a.js" --require "./b.js"
19541cb0ef41Sopenharmony_ci```
19551cb0ef41Sopenharmony_ci
19561cb0ef41Sopenharmony_ciNode.js options that are allowed are:
19571cb0ef41Sopenharmony_ci
19581cb0ef41Sopenharmony_ci<!-- node-options-node start -->
19591cb0ef41Sopenharmony_ci
19601cb0ef41Sopenharmony_ci* `--conditions`, `-C`
19611cb0ef41Sopenharmony_ci* `--diagnostic-dir`
19621cb0ef41Sopenharmony_ci* `--disable-proto`
19631cb0ef41Sopenharmony_ci* `--dns-result-order`
19641cb0ef41Sopenharmony_ci* `--enable-fips`
19651cb0ef41Sopenharmony_ci* `--enable-network-family-autoselection`
19661cb0ef41Sopenharmony_ci* `--enable-source-maps`
19671cb0ef41Sopenharmony_ci* `--experimental-abortcontroller`
19681cb0ef41Sopenharmony_ci* `--experimental-default-type`
19691cb0ef41Sopenharmony_ci* `--experimental-global-customevent`
19701cb0ef41Sopenharmony_ci* `--experimental-global-webcrypto`
19711cb0ef41Sopenharmony_ci* `--experimental-import-meta-resolve`
19721cb0ef41Sopenharmony_ci* `--experimental-json-modules`
19731cb0ef41Sopenharmony_ci* `--experimental-loader`
19741cb0ef41Sopenharmony_ci* `--experimental-modules`
19751cb0ef41Sopenharmony_ci* `--experimental-network-imports`
19761cb0ef41Sopenharmony_ci* `--experimental-policy`
19771cb0ef41Sopenharmony_ci* `--experimental-shadow-realm`
19781cb0ef41Sopenharmony_ci* `--experimental-specifier-resolution`
19791cb0ef41Sopenharmony_ci* `--experimental-top-level-await`
19801cb0ef41Sopenharmony_ci* `--experimental-vm-modules`
19811cb0ef41Sopenharmony_ci* `--experimental-wasi-unstable-preview1`
19821cb0ef41Sopenharmony_ci* `--experimental-wasm-modules`
19831cb0ef41Sopenharmony_ci* `--force-context-aware`
19841cb0ef41Sopenharmony_ci* `--force-fips`
19851cb0ef41Sopenharmony_ci* `--force-node-api-uncaught-exceptions-policy`
19861cb0ef41Sopenharmony_ci* `--frozen-intrinsics`
19871cb0ef41Sopenharmony_ci* `--heapsnapshot-near-heap-limit`
19881cb0ef41Sopenharmony_ci* `--heapsnapshot-signal`
19891cb0ef41Sopenharmony_ci* `--http-parser`
19901cb0ef41Sopenharmony_ci* `--icu-data-dir`
19911cb0ef41Sopenharmony_ci* `--import`
19921cb0ef41Sopenharmony_ci* `--input-type`
19931cb0ef41Sopenharmony_ci* `--insecure-http-parser`
19941cb0ef41Sopenharmony_ci* `--inspect-brk`
19951cb0ef41Sopenharmony_ci* `--inspect-port`, `--debug-port`
19961cb0ef41Sopenharmony_ci* `--inspect-publish-uid`
19971cb0ef41Sopenharmony_ci* `--inspect`
19981cb0ef41Sopenharmony_ci* `--max-http-header-size`
19991cb0ef41Sopenharmony_ci* `--napi-modules`
20001cb0ef41Sopenharmony_ci* `--no-addons`
20011cb0ef41Sopenharmony_ci* `--no-deprecation`
20021cb0ef41Sopenharmony_ci* `--no-experimental-fetch`
20031cb0ef41Sopenharmony_ci* `--no-experimental-repl-await`
20041cb0ef41Sopenharmony_ci* `--no-extra-info-on-fatal-exception`
20051cb0ef41Sopenharmony_ci* `--no-force-async-hooks-checks`
20061cb0ef41Sopenharmony_ci* `--no-global-search-paths`
20071cb0ef41Sopenharmony_ci* `--no-warnings`
20081cb0ef41Sopenharmony_ci* `--node-memory-debug`
20091cb0ef41Sopenharmony_ci* `--openssl-config`
20101cb0ef41Sopenharmony_ci* `--openssl-legacy-provider`
20111cb0ef41Sopenharmony_ci* `--openssl-shared-config`
20121cb0ef41Sopenharmony_ci* `--pending-deprecation`
20131cb0ef41Sopenharmony_ci* `--policy-integrity`
20141cb0ef41Sopenharmony_ci* `--preserve-symlinks-main`
20151cb0ef41Sopenharmony_ci* `--preserve-symlinks`
20161cb0ef41Sopenharmony_ci* `--prof-process`
20171cb0ef41Sopenharmony_ci* `--redirect-warnings`
20181cb0ef41Sopenharmony_ci* `--report-compact`
20191cb0ef41Sopenharmony_ci* `--report-dir`, `--report-directory`
20201cb0ef41Sopenharmony_ci* `--report-filename`
20211cb0ef41Sopenharmony_ci* `--report-on-fatalerror`
20221cb0ef41Sopenharmony_ci* `--report-on-signal`
20231cb0ef41Sopenharmony_ci* `--report-signal`
20241cb0ef41Sopenharmony_ci* `--report-uncaught-exception`
20251cb0ef41Sopenharmony_ci* `--require`, `-r`
20261cb0ef41Sopenharmony_ci* `--secure-heap-min`
20271cb0ef41Sopenharmony_ci* `--secure-heap`
20281cb0ef41Sopenharmony_ci* `--snapshot-blob`
20291cb0ef41Sopenharmony_ci* `--test-only`
20301cb0ef41Sopenharmony_ci* `--test-reporter-destination`
20311cb0ef41Sopenharmony_ci* `--test-reporter`
20321cb0ef41Sopenharmony_ci* `--test-shard`
20331cb0ef41Sopenharmony_ci* `--throw-deprecation`
20341cb0ef41Sopenharmony_ci* `--title`
20351cb0ef41Sopenharmony_ci* `--tls-cipher-list`
20361cb0ef41Sopenharmony_ci* `--tls-keylog`
20371cb0ef41Sopenharmony_ci* `--tls-max-v1.2`
20381cb0ef41Sopenharmony_ci* `--tls-max-v1.3`
20391cb0ef41Sopenharmony_ci* `--tls-min-v1.0`
20401cb0ef41Sopenharmony_ci* `--tls-min-v1.1`
20411cb0ef41Sopenharmony_ci* `--tls-min-v1.2`
20421cb0ef41Sopenharmony_ci* `--tls-min-v1.3`
20431cb0ef41Sopenharmony_ci* `--trace-atomics-wait`
20441cb0ef41Sopenharmony_ci* `--trace-deprecation`
20451cb0ef41Sopenharmony_ci* `--trace-event-categories`
20461cb0ef41Sopenharmony_ci* `--trace-event-file-pattern`
20471cb0ef41Sopenharmony_ci* `--trace-events-enabled`
20481cb0ef41Sopenharmony_ci* `--trace-exit`
20491cb0ef41Sopenharmony_ci* `--trace-sigint`
20501cb0ef41Sopenharmony_ci* `--trace-sync-io`
20511cb0ef41Sopenharmony_ci* `--trace-tls`
20521cb0ef41Sopenharmony_ci* `--trace-uncaught`
20531cb0ef41Sopenharmony_ci* `--trace-warnings`
20541cb0ef41Sopenharmony_ci* `--track-heap-objects`
20551cb0ef41Sopenharmony_ci* `--unhandled-rejections`
20561cb0ef41Sopenharmony_ci* `--use-bundled-ca`
20571cb0ef41Sopenharmony_ci* `--use-largepages`
20581cb0ef41Sopenharmony_ci* `--use-openssl-ca`
20591cb0ef41Sopenharmony_ci* `--v8-pool-size`
20601cb0ef41Sopenharmony_ci* `--watch-path`
20611cb0ef41Sopenharmony_ci* `--watch-preserve-output`
20621cb0ef41Sopenharmony_ci* `--watch`
20631cb0ef41Sopenharmony_ci* `--zero-fill-buffers`
20641cb0ef41Sopenharmony_ci
20651cb0ef41Sopenharmony_ci<!-- node-options-node end -->
20661cb0ef41Sopenharmony_ci
20671cb0ef41Sopenharmony_ciV8 options that are allowed are:
20681cb0ef41Sopenharmony_ci
20691cb0ef41Sopenharmony_ci<!-- node-options-v8 start -->
20701cb0ef41Sopenharmony_ci
20711cb0ef41Sopenharmony_ci* `--abort-on-uncaught-exception`
20721cb0ef41Sopenharmony_ci* `--disallow-code-generation-from-strings`
20731cb0ef41Sopenharmony_ci* `--enable-etw-stack-walking`
20741cb0ef41Sopenharmony_ci* `--huge-max-old-generation-size`
20751cb0ef41Sopenharmony_ci* `--interpreted-frames-native-stack`
20761cb0ef41Sopenharmony_ci* `--jitless`
20771cb0ef41Sopenharmony_ci* `--max-old-space-size`
20781cb0ef41Sopenharmony_ci* `--max-semi-space-size`
20791cb0ef41Sopenharmony_ci* `--perf-basic-prof-only-functions`
20801cb0ef41Sopenharmony_ci* `--perf-basic-prof`
20811cb0ef41Sopenharmony_ci* `--perf-prof-unwinding-info`
20821cb0ef41Sopenharmony_ci* `--perf-prof`
20831cb0ef41Sopenharmony_ci* `--stack-trace-limit`
20841cb0ef41Sopenharmony_ci
20851cb0ef41Sopenharmony_ci<!-- node-options-v8 end -->
20861cb0ef41Sopenharmony_ci
20871cb0ef41Sopenharmony_ci`--perf-basic-prof-only-functions`, `--perf-basic-prof`,
20881cb0ef41Sopenharmony_ci`--perf-prof-unwinding-info`, and `--perf-prof` are only available on Linux.
20891cb0ef41Sopenharmony_ci
20901cb0ef41Sopenharmony_ci`--enable-etw-stack-walking` is only available on Windows.
20911cb0ef41Sopenharmony_ci
20921cb0ef41Sopenharmony_ci### `NODE_PATH=path[:…]`
20931cb0ef41Sopenharmony_ci
20941cb0ef41Sopenharmony_ci<!-- YAML
20951cb0ef41Sopenharmony_ciadded: v0.1.32
20961cb0ef41Sopenharmony_ci-->
20971cb0ef41Sopenharmony_ci
20981cb0ef41Sopenharmony_ci`':'`-separated list of directories prefixed to the module search path.
20991cb0ef41Sopenharmony_ci
21001cb0ef41Sopenharmony_ciOn Windows, this is a `';'`-separated list instead.
21011cb0ef41Sopenharmony_ci
21021cb0ef41Sopenharmony_ci### `NODE_PENDING_DEPRECATION=1`
21031cb0ef41Sopenharmony_ci
21041cb0ef41Sopenharmony_ci<!-- YAML
21051cb0ef41Sopenharmony_ciadded: v8.0.0
21061cb0ef41Sopenharmony_ci-->
21071cb0ef41Sopenharmony_ci
21081cb0ef41Sopenharmony_ciWhen set to `1`, emit pending deprecation warnings.
21091cb0ef41Sopenharmony_ci
21101cb0ef41Sopenharmony_ciPending deprecations are generally identical to a runtime deprecation with the
21111cb0ef41Sopenharmony_cinotable exception that they are turned _off_ by default and will not be emitted
21121cb0ef41Sopenharmony_ciunless either the `--pending-deprecation` command-line flag, or the
21131cb0ef41Sopenharmony_ci`NODE_PENDING_DEPRECATION=1` environment variable, is set. Pending deprecations
21141cb0ef41Sopenharmony_ciare used to provide a kind of selective "early warning" mechanism that
21151cb0ef41Sopenharmony_cidevelopers may leverage to detect deprecated API usage.
21161cb0ef41Sopenharmony_ci
21171cb0ef41Sopenharmony_ci### `NODE_PENDING_PIPE_INSTANCES=instances`
21181cb0ef41Sopenharmony_ci
21191cb0ef41Sopenharmony_ciSet the number of pending pipe instance handles when the pipe server is waiting
21201cb0ef41Sopenharmony_cifor connections. This setting applies to Windows only.
21211cb0ef41Sopenharmony_ci
21221cb0ef41Sopenharmony_ci### `NODE_PRESERVE_SYMLINKS=1`
21231cb0ef41Sopenharmony_ci
21241cb0ef41Sopenharmony_ci<!-- YAML
21251cb0ef41Sopenharmony_ciadded: v7.1.0
21261cb0ef41Sopenharmony_ci-->
21271cb0ef41Sopenharmony_ci
21281cb0ef41Sopenharmony_ciWhen set to `1`, instructs the module loader to preserve symbolic links when
21291cb0ef41Sopenharmony_ciresolving and caching modules.
21301cb0ef41Sopenharmony_ci
21311cb0ef41Sopenharmony_ci### `NODE_REDIRECT_WARNINGS=file`
21321cb0ef41Sopenharmony_ci
21331cb0ef41Sopenharmony_ci<!-- YAML
21341cb0ef41Sopenharmony_ciadded: v8.0.0
21351cb0ef41Sopenharmony_ci-->
21361cb0ef41Sopenharmony_ci
21371cb0ef41Sopenharmony_ciWhen set, process warnings will be emitted to the given file instead of
21381cb0ef41Sopenharmony_ciprinting to stderr. The file will be created if it does not exist, and will be
21391cb0ef41Sopenharmony_ciappended to if it does. If an error occurs while attempting to write the
21401cb0ef41Sopenharmony_ciwarning to the file, the warning will be written to stderr instead. This is
21411cb0ef41Sopenharmony_ciequivalent to using the `--redirect-warnings=file` command-line flag.
21421cb0ef41Sopenharmony_ci
21431cb0ef41Sopenharmony_ci### `NODE_REPL_HISTORY=file`
21441cb0ef41Sopenharmony_ci
21451cb0ef41Sopenharmony_ci<!-- YAML
21461cb0ef41Sopenharmony_ciadded: v3.0.0
21471cb0ef41Sopenharmony_ci-->
21481cb0ef41Sopenharmony_ci
21491cb0ef41Sopenharmony_ciPath to the file used to store the persistent REPL history. The default path is
21501cb0ef41Sopenharmony_ci`~/.node_repl_history`, which is overridden by this variable. Setting the value
21511cb0ef41Sopenharmony_cito an empty string (`''` or `' '`) disables persistent REPL history.
21521cb0ef41Sopenharmony_ci
21531cb0ef41Sopenharmony_ci### `NODE_REPL_EXTERNAL_MODULE=file`
21541cb0ef41Sopenharmony_ci
21551cb0ef41Sopenharmony_ci<!-- YAML
21561cb0ef41Sopenharmony_ciadded:
21571cb0ef41Sopenharmony_ci - v13.0.0
21581cb0ef41Sopenharmony_ci - v12.16.0
21591cb0ef41Sopenharmony_ci-->
21601cb0ef41Sopenharmony_ci
21611cb0ef41Sopenharmony_ciPath to a Node.js module which will be loaded in place of the built-in REPL.
21621cb0ef41Sopenharmony_ciOverriding this value to an empty string (`''`) will use the built-in REPL.
21631cb0ef41Sopenharmony_ci
21641cb0ef41Sopenharmony_ci### `NODE_SKIP_PLATFORM_CHECK=value`
21651cb0ef41Sopenharmony_ci
21661cb0ef41Sopenharmony_ci<!-- YAML
21671cb0ef41Sopenharmony_ciadded: v14.5.0
21681cb0ef41Sopenharmony_ci-->
21691cb0ef41Sopenharmony_ci
21701cb0ef41Sopenharmony_ciIf `value` equals `'1'`, the check for a supported platform is skipped during
21711cb0ef41Sopenharmony_ciNode.js startup. Node.js might not execute correctly. Any issues encountered
21721cb0ef41Sopenharmony_cion unsupported platforms will not be fixed.
21731cb0ef41Sopenharmony_ci
21741cb0ef41Sopenharmony_ci### `NODE_TEST_CONTEXT=value`
21751cb0ef41Sopenharmony_ci
21761cb0ef41Sopenharmony_ciIf `value` equals `'child'`, test reporter options will be overridden and test
21771cb0ef41Sopenharmony_cioutput will be sent to stdout in the TAP format. If any other value is provided,
21781cb0ef41Sopenharmony_ciNode.js makes no guarantees about the reporter format used or its stability.
21791cb0ef41Sopenharmony_ci
21801cb0ef41Sopenharmony_ci### `NODE_TLS_REJECT_UNAUTHORIZED=value`
21811cb0ef41Sopenharmony_ci
21821cb0ef41Sopenharmony_ciIf `value` equals `'0'`, certificate validation is disabled for TLS connections.
21831cb0ef41Sopenharmony_ciThis makes TLS, and HTTPS by extension, insecure. The use of this environment
21841cb0ef41Sopenharmony_civariable is strongly discouraged.
21851cb0ef41Sopenharmony_ci
21861cb0ef41Sopenharmony_ci### `NODE_V8_COVERAGE=dir`
21871cb0ef41Sopenharmony_ci
21881cb0ef41Sopenharmony_ciWhen set, Node.js will begin outputting [V8 JavaScript code coverage][] and
21891cb0ef41Sopenharmony_ci[Source Map][] data to the directory provided as an argument (coverage
21901cb0ef41Sopenharmony_ciinformation is written as JSON to files with a `coverage` prefix).
21911cb0ef41Sopenharmony_ci
21921cb0ef41Sopenharmony_ci`NODE_V8_COVERAGE` will automatically propagate to subprocesses, making it
21931cb0ef41Sopenharmony_cieasier to instrument applications that call the `child_process.spawn()` family
21941cb0ef41Sopenharmony_ciof functions. `NODE_V8_COVERAGE` can be set to an empty string, to prevent
21951cb0ef41Sopenharmony_cipropagation.
21961cb0ef41Sopenharmony_ci
21971cb0ef41Sopenharmony_ci#### Coverage output
21981cb0ef41Sopenharmony_ci
21991cb0ef41Sopenharmony_ciCoverage is output as an array of [ScriptCoverage][] objects on the top-level
22001cb0ef41Sopenharmony_cikey `result`:
22011cb0ef41Sopenharmony_ci
22021cb0ef41Sopenharmony_ci```json
22031cb0ef41Sopenharmony_ci{
22041cb0ef41Sopenharmony_ci  "result": [
22051cb0ef41Sopenharmony_ci    {
22061cb0ef41Sopenharmony_ci      "scriptId": "67",
22071cb0ef41Sopenharmony_ci      "url": "internal/tty.js",
22081cb0ef41Sopenharmony_ci      "functions": []
22091cb0ef41Sopenharmony_ci    }
22101cb0ef41Sopenharmony_ci  ]
22111cb0ef41Sopenharmony_ci}
22121cb0ef41Sopenharmony_ci```
22131cb0ef41Sopenharmony_ci
22141cb0ef41Sopenharmony_ci#### Source map cache
22151cb0ef41Sopenharmony_ci
22161cb0ef41Sopenharmony_ci> Stability: 1 - Experimental
22171cb0ef41Sopenharmony_ci
22181cb0ef41Sopenharmony_ciIf found, source map data is appended to the top-level key `source-map-cache`
22191cb0ef41Sopenharmony_cion the JSON coverage object.
22201cb0ef41Sopenharmony_ci
22211cb0ef41Sopenharmony_ci`source-map-cache` is an object with keys representing the files source maps
22221cb0ef41Sopenharmony_ciwere extracted from, and values which include the raw source-map URL
22231cb0ef41Sopenharmony_ci(in the key `url`), the parsed Source Map v3 information (in the key `data`),
22241cb0ef41Sopenharmony_ciand the line lengths of the source file (in the key `lineLengths`).
22251cb0ef41Sopenharmony_ci
22261cb0ef41Sopenharmony_ci```json
22271cb0ef41Sopenharmony_ci{
22281cb0ef41Sopenharmony_ci  "result": [
22291cb0ef41Sopenharmony_ci    {
22301cb0ef41Sopenharmony_ci      "scriptId": "68",
22311cb0ef41Sopenharmony_ci      "url": "file:///absolute/path/to/source.js",
22321cb0ef41Sopenharmony_ci      "functions": []
22331cb0ef41Sopenharmony_ci    }
22341cb0ef41Sopenharmony_ci  ],
22351cb0ef41Sopenharmony_ci  "source-map-cache": {
22361cb0ef41Sopenharmony_ci    "file:///absolute/path/to/source.js": {
22371cb0ef41Sopenharmony_ci      "url": "./path-to-map.json",
22381cb0ef41Sopenharmony_ci      "data": {
22391cb0ef41Sopenharmony_ci        "version": 3,
22401cb0ef41Sopenharmony_ci        "sources": [
22411cb0ef41Sopenharmony_ci          "file:///absolute/path/to/original.js"
22421cb0ef41Sopenharmony_ci        ],
22431cb0ef41Sopenharmony_ci        "names": [
22441cb0ef41Sopenharmony_ci          "Foo",
22451cb0ef41Sopenharmony_ci          "console",
22461cb0ef41Sopenharmony_ci          "info"
22471cb0ef41Sopenharmony_ci        ],
22481cb0ef41Sopenharmony_ci        "mappings": "MAAMA,IACJC,YAAaC",
22491cb0ef41Sopenharmony_ci        "sourceRoot": "./"
22501cb0ef41Sopenharmony_ci      },
22511cb0ef41Sopenharmony_ci      "lineLengths": [
22521cb0ef41Sopenharmony_ci        13,
22531cb0ef41Sopenharmony_ci        62,
22541cb0ef41Sopenharmony_ci        38,
22551cb0ef41Sopenharmony_ci        27
22561cb0ef41Sopenharmony_ci      ]
22571cb0ef41Sopenharmony_ci    }
22581cb0ef41Sopenharmony_ci  }
22591cb0ef41Sopenharmony_ci}
22601cb0ef41Sopenharmony_ci```
22611cb0ef41Sopenharmony_ci
22621cb0ef41Sopenharmony_ci### `NO_COLOR=<any>`
22631cb0ef41Sopenharmony_ci
22641cb0ef41Sopenharmony_ci[`NO_COLOR`][]  is an alias for `NODE_DISABLE_COLORS`. The value of the
22651cb0ef41Sopenharmony_cienvironment variable is arbitrary.
22661cb0ef41Sopenharmony_ci
22671cb0ef41Sopenharmony_ci### `OPENSSL_CONF=file`
22681cb0ef41Sopenharmony_ci
22691cb0ef41Sopenharmony_ci<!-- YAML
22701cb0ef41Sopenharmony_ciadded: v6.11.0
22711cb0ef41Sopenharmony_ci-->
22721cb0ef41Sopenharmony_ci
22731cb0ef41Sopenharmony_ciLoad an OpenSSL configuration file on startup. Among other uses, this can be
22741cb0ef41Sopenharmony_ciused to enable FIPS-compliant crypto if Node.js is built with
22751cb0ef41Sopenharmony_ci`./configure --openssl-fips`.
22761cb0ef41Sopenharmony_ci
22771cb0ef41Sopenharmony_ciIf the [`--openssl-config`][] command-line option is used, the environment
22781cb0ef41Sopenharmony_civariable is ignored.
22791cb0ef41Sopenharmony_ci
22801cb0ef41Sopenharmony_ci### `SSL_CERT_DIR=dir`
22811cb0ef41Sopenharmony_ci
22821cb0ef41Sopenharmony_ci<!-- YAML
22831cb0ef41Sopenharmony_ciadded: v7.7.0
22841cb0ef41Sopenharmony_ci-->
22851cb0ef41Sopenharmony_ci
22861cb0ef41Sopenharmony_ciIf `--use-openssl-ca` is enabled, this overrides and sets OpenSSL's directory
22871cb0ef41Sopenharmony_cicontaining trusted certificates.
22881cb0ef41Sopenharmony_ci
22891cb0ef41Sopenharmony_ciBe aware that unless the child environment is explicitly set, this environment
22901cb0ef41Sopenharmony_civariable will be inherited by any child processes, and if they use OpenSSL, it
22911cb0ef41Sopenharmony_cimay cause them to trust the same CAs as node.
22921cb0ef41Sopenharmony_ci
22931cb0ef41Sopenharmony_ci### `SSL_CERT_FILE=file`
22941cb0ef41Sopenharmony_ci
22951cb0ef41Sopenharmony_ci<!-- YAML
22961cb0ef41Sopenharmony_ciadded: v7.7.0
22971cb0ef41Sopenharmony_ci-->
22981cb0ef41Sopenharmony_ci
22991cb0ef41Sopenharmony_ciIf `--use-openssl-ca` is enabled, this overrides and sets OpenSSL's file
23001cb0ef41Sopenharmony_cicontaining trusted certificates.
23011cb0ef41Sopenharmony_ci
23021cb0ef41Sopenharmony_ciBe aware that unless the child environment is explicitly set, this environment
23031cb0ef41Sopenharmony_civariable will be inherited by any child processes, and if they use OpenSSL, it
23041cb0ef41Sopenharmony_cimay cause them to trust the same CAs as node.
23051cb0ef41Sopenharmony_ci
23061cb0ef41Sopenharmony_ci### `TZ`
23071cb0ef41Sopenharmony_ci
23081cb0ef41Sopenharmony_ci<!-- YAML
23091cb0ef41Sopenharmony_ciadded: v0.0.1
23101cb0ef41Sopenharmony_cichanges:
23111cb0ef41Sopenharmony_ci  - version:
23121cb0ef41Sopenharmony_ci     - v16.2.0
23131cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/38642
23141cb0ef41Sopenharmony_ci    description:
23151cb0ef41Sopenharmony_ci      Changing the TZ variable using process.env.TZ = changes the timezone
23161cb0ef41Sopenharmony_ci      on Windows as well.
23171cb0ef41Sopenharmony_ci  - version:
23181cb0ef41Sopenharmony_ci     - v13.0.0
23191cb0ef41Sopenharmony_ci    pr-url: https://github.com/nodejs/node/pull/20026
23201cb0ef41Sopenharmony_ci    description:
23211cb0ef41Sopenharmony_ci      Changing the TZ variable using process.env.TZ = changes the timezone
23221cb0ef41Sopenharmony_ci      on POSIX systems.
23231cb0ef41Sopenharmony_ci-->
23241cb0ef41Sopenharmony_ci
23251cb0ef41Sopenharmony_ciThe `TZ` environment variable is used to specify the timezone configuration.
23261cb0ef41Sopenharmony_ci
23271cb0ef41Sopenharmony_ciWhile Node.js does not support all of the various [ways that `TZ` is handled in
23281cb0ef41Sopenharmony_ciother environments][], it does support basic [timezone IDs][] (such as
23291cb0ef41Sopenharmony_ci`'Etc/UTC'`, `'Europe/Paris'`, or `'America/New_York'`).
23301cb0ef41Sopenharmony_ciIt may support a few other abbreviations or aliases, but these are strongly
23311cb0ef41Sopenharmony_cidiscouraged and not guaranteed.
23321cb0ef41Sopenharmony_ci
23331cb0ef41Sopenharmony_ci```console
23341cb0ef41Sopenharmony_ci$ TZ=Europe/Dublin node -pe "new Date().toString()"
23351cb0ef41Sopenharmony_ciWed May 12 2021 20:30:48 GMT+0100 (Irish Standard Time)
23361cb0ef41Sopenharmony_ci```
23371cb0ef41Sopenharmony_ci
23381cb0ef41Sopenharmony_ci### `UV_THREADPOOL_SIZE=size`
23391cb0ef41Sopenharmony_ci
23401cb0ef41Sopenharmony_ciSet the number of threads used in libuv's threadpool to `size` threads.
23411cb0ef41Sopenharmony_ci
23421cb0ef41Sopenharmony_ciAsynchronous system APIs are used by Node.js whenever possible, but where they
23431cb0ef41Sopenharmony_cido not exist, libuv's threadpool is used to create asynchronous node APIs based
23441cb0ef41Sopenharmony_cion synchronous system APIs. Node.js APIs that use the threadpool are:
23451cb0ef41Sopenharmony_ci
23461cb0ef41Sopenharmony_ci* all `fs` APIs, other than the file watcher APIs and those that are explicitly
23471cb0ef41Sopenharmony_ci  synchronous
23481cb0ef41Sopenharmony_ci* asynchronous crypto APIs such as `crypto.pbkdf2()`, `crypto.scrypt()`,
23491cb0ef41Sopenharmony_ci  `crypto.randomBytes()`, `crypto.randomFill()`, `crypto.generateKeyPair()`
23501cb0ef41Sopenharmony_ci* `dns.lookup()`
23511cb0ef41Sopenharmony_ci* all `zlib` APIs, other than those that are explicitly synchronous
23521cb0ef41Sopenharmony_ci
23531cb0ef41Sopenharmony_ciBecause libuv's threadpool has a fixed size, it means that if for whatever
23541cb0ef41Sopenharmony_cireason any of these APIs takes a long time, other (seemingly unrelated) APIs
23551cb0ef41Sopenharmony_cithat run in libuv's threadpool will experience degraded performance. In order to
23561cb0ef41Sopenharmony_cimitigate this issue, one potential solution is to increase the size of libuv's
23571cb0ef41Sopenharmony_cithreadpool by setting the `'UV_THREADPOOL_SIZE'` environment variable to a value
23581cb0ef41Sopenharmony_cigreater than `4` (its current default value). For more information, see the
23591cb0ef41Sopenharmony_ci[libuv threadpool documentation][].
23601cb0ef41Sopenharmony_ci
23611cb0ef41Sopenharmony_ci## Useful V8 options
23621cb0ef41Sopenharmony_ci
23631cb0ef41Sopenharmony_ciV8 has its own set of CLI options. Any V8 CLI option that is provided to `node`
23641cb0ef41Sopenharmony_ciwill be passed on to V8 to handle. V8's options have _no stability guarantee_.
23651cb0ef41Sopenharmony_ciThe V8 team themselves don't consider them to be part of their formal API,
23661cb0ef41Sopenharmony_ciand reserve the right to change them at any time. Likewise, they are not
23671cb0ef41Sopenharmony_cicovered by the Node.js stability guarantees. Many of the V8
23681cb0ef41Sopenharmony_cioptions are of interest only to V8 developers. Despite this, there is a small
23691cb0ef41Sopenharmony_ciset of V8 options that are widely applicable to Node.js, and they are
23701cb0ef41Sopenharmony_cidocumented here:
23711cb0ef41Sopenharmony_ci
23721cb0ef41Sopenharmony_ci### `--max-old-space-size=SIZE` (in megabytes)
23731cb0ef41Sopenharmony_ci
23741cb0ef41Sopenharmony_ciSets the max memory size of V8's old memory section. As memory
23751cb0ef41Sopenharmony_ciconsumption approaches the limit, V8 will spend more time on
23761cb0ef41Sopenharmony_cigarbage collection in an effort to free unused memory.
23771cb0ef41Sopenharmony_ci
23781cb0ef41Sopenharmony_ciOn a machine with 2 GiB of memory, consider setting this to
23791cb0ef41Sopenharmony_ci1536 (1.5 GiB) to leave some memory for other uses and avoid swapping.
23801cb0ef41Sopenharmony_ci
23811cb0ef41Sopenharmony_ci```console
23821cb0ef41Sopenharmony_ci$ node --max-old-space-size=1536 index.js
23831cb0ef41Sopenharmony_ci```
23841cb0ef41Sopenharmony_ci
23851cb0ef41Sopenharmony_ci### `--max-semi-space-size=SIZE` (in megabytes)
23861cb0ef41Sopenharmony_ci
23871cb0ef41Sopenharmony_ciSets the maximum [semi-space][] size for V8's [scavenge garbage collector][] in
23881cb0ef41Sopenharmony_ciMiB (megabytes).
23891cb0ef41Sopenharmony_ciIncreasing the max size of a semi-space may improve throughput for Node.js at
23901cb0ef41Sopenharmony_cithe cost of more memory consumption.
23911cb0ef41Sopenharmony_ci
23921cb0ef41Sopenharmony_ciSince the young generation size of the V8 heap is three times (see
23931cb0ef41Sopenharmony_ci[`YoungGenerationSizeFromSemiSpaceSize`][] in V8) the size of the semi-space,
23941cb0ef41Sopenharmony_cian increase of 1 MiB to semi-space applies to each of the three individual
23951cb0ef41Sopenharmony_cisemi-spaces and causes the heap size to increase by 3 MiB. The throughput
23961cb0ef41Sopenharmony_ciimprovement depends on your workload (see [#42511][]).
23971cb0ef41Sopenharmony_ci
23981cb0ef41Sopenharmony_ciThe default value is 16 MiB for 64-bit systems and 8 MiB for 32-bit systems. To
23991cb0ef41Sopenharmony_ciget the best configuration for your application, you should try different
24001cb0ef41Sopenharmony_cimax-semi-space-size values when running benchmarks for your application.
24011cb0ef41Sopenharmony_ci
24021cb0ef41Sopenharmony_ciFor example, benchmark on a 64-bit systems:
24031cb0ef41Sopenharmony_ci
24041cb0ef41Sopenharmony_ci```bash
24051cb0ef41Sopenharmony_cifor MiB in 16 32 64 128; do
24061cb0ef41Sopenharmony_ci    node --max-semi-space-size=$MiB index.js
24071cb0ef41Sopenharmony_cidone
24081cb0ef41Sopenharmony_ci```
24091cb0ef41Sopenharmony_ci
24101cb0ef41Sopenharmony_ci[#42511]: https://github.com/nodejs/node/issues/42511
24111cb0ef41Sopenharmony_ci[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
24121cb0ef41Sopenharmony_ci[CommonJS]: modules.md
24131cb0ef41Sopenharmony_ci[CommonJS module]: modules.md
24141cb0ef41Sopenharmony_ci[CustomEvent Web API]: https://dom.spec.whatwg.org/#customevent
24151cb0ef41Sopenharmony_ci[ECMAScript module]: esm.md#modules-ecmascript-modules
24161cb0ef41Sopenharmony_ci[Fetch API]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
24171cb0ef41Sopenharmony_ci[Module customization hooks]: module.md#customization-hooks
24181cb0ef41Sopenharmony_ci[Module customization hooks: enabling]: module.md#enabling
24191cb0ef41Sopenharmony_ci[Modules loaders]: packages.md#modules-loaders
24201cb0ef41Sopenharmony_ci[Node.js issue tracker]: https://github.com/nodejs/node/issues
24211cb0ef41Sopenharmony_ci[OSSL_PROVIDER-legacy]: https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html
24221cb0ef41Sopenharmony_ci[REPL]: repl.md
24231cb0ef41Sopenharmony_ci[ScriptCoverage]: https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage
24241cb0ef41Sopenharmony_ci[ShadowRealm]: https://github.com/tc39/proposal-shadowrealm
24251cb0ef41Sopenharmony_ci[Source Map]: https://sourcemaps.info/spec.html
24261cb0ef41Sopenharmony_ci[Subresource Integrity]: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
24271cb0ef41Sopenharmony_ci[V8 JavaScript code coverage]: https://v8project.blogspot.com/2017/12/javascript-code-coverage.html
24281cb0ef41Sopenharmony_ci[Web Crypto API]: webcrypto.md
24291cb0ef41Sopenharmony_ci[`"type"`]: packages.md#type
24301cb0ef41Sopenharmony_ci[`--cpu-prof-dir`]: #--cpu-prof-dir
24311cb0ef41Sopenharmony_ci[`--diagnostic-dir`]: #--diagnostic-dirdirectory
24321cb0ef41Sopenharmony_ci[`--experimental-default-type=module`]: #--experimental-default-typetype
24331cb0ef41Sopenharmony_ci[`--experimental-wasm-modules`]: #--experimental-wasm-modules
24341cb0ef41Sopenharmony_ci[`--heap-prof-dir`]: #--heap-prof-dir
24351cb0ef41Sopenharmony_ci[`--import`]: #--importmodule
24361cb0ef41Sopenharmony_ci[`--openssl-config`]: #--openssl-configfile
24371cb0ef41Sopenharmony_ci[`--preserve-symlinks`]: #--preserve-symlinks
24381cb0ef41Sopenharmony_ci[`--redirect-warnings`]: #--redirect-warningsfile
24391cb0ef41Sopenharmony_ci[`--require`]: #-r---require-module
24401cb0ef41Sopenharmony_ci[`Atomics.wait()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait
24411cb0ef41Sopenharmony_ci[`Buffer`]: buffer.md#class-buffer
24421cb0ef41Sopenharmony_ci[`CRYPTO_secure_malloc_init`]: https://www.openssl.org/docs/man3.0/man3/CRYPTO_secure_malloc_init.html
24431cb0ef41Sopenharmony_ci[`NODE_OPTIONS`]: #node_optionsoptions
24441cb0ef41Sopenharmony_ci[`NO_COLOR`]: https://no-color.org
24451cb0ef41Sopenharmony_ci[`SlowBuffer`]: buffer.md#class-slowbuffer
24461cb0ef41Sopenharmony_ci[`YoungGenerationSizeFromSemiSpaceSize`]: https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.3.129/src/heap/heap.cc#328
24471cb0ef41Sopenharmony_ci[`dns.lookup()`]: dns.md#dnslookuphostname-options-callback
24481cb0ef41Sopenharmony_ci[`dns.setDefaultResultOrder()`]: dns.md#dnssetdefaultresultorderorder
24491cb0ef41Sopenharmony_ci[`dnsPromises.lookup()`]: dns.md#dnspromiseslookuphostname-options
24501cb0ef41Sopenharmony_ci[`import` specifier]: esm.md#import-specifiers
24511cb0ef41Sopenharmony_ci[`process.setUncaughtExceptionCaptureCallback()`]: process.md#processsetuncaughtexceptioncapturecallbackfn
24521cb0ef41Sopenharmony_ci[`tls.DEFAULT_MAX_VERSION`]: tls.md#tlsdefault_max_version
24531cb0ef41Sopenharmony_ci[`tls.DEFAULT_MIN_VERSION`]: tls.md#tlsdefault_min_version
24541cb0ef41Sopenharmony_ci[`unhandledRejection`]: process.md#event-unhandledrejection
24551cb0ef41Sopenharmony_ci[`v8.startupSnapshot` API]: v8.md#startup-snapshot-api
24561cb0ef41Sopenharmony_ci[`worker_threads.threadId`]: worker_threads.md#workerthreadid
24571cb0ef41Sopenharmony_ci[collecting code coverage from tests]: test.md#collecting-code-coverage
24581cb0ef41Sopenharmony_ci[conditional exports]: packages.md#conditional-exports
24591cb0ef41Sopenharmony_ci[context-aware]: addons.md#context-aware-addons
24601cb0ef41Sopenharmony_ci[customizing ESM specifier resolution]: esm.md#customizing-esm-specifier-resolution-algorithm
24611cb0ef41Sopenharmony_ci[debugger]: debugger.md
24621cb0ef41Sopenharmony_ci[debugging security implications]: https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
24631cb0ef41Sopenharmony_ci[emit_warning]: process.md#processemitwarningwarning-options
24641cb0ef41Sopenharmony_ci[filtering tests by name]: test.md#filtering-tests-by-name
24651cb0ef41Sopenharmony_ci[jitless]: https://v8.dev/blog/jitless
24661cb0ef41Sopenharmony_ci[libuv threadpool documentation]: https://docs.libuv.org/en/latest/threadpool.html
24671cb0ef41Sopenharmony_ci[remote code execution]: https://www.owasp.org/index.php/Code_Injection
24681cb0ef41Sopenharmony_ci[running tests from the command line]: test.md#running-tests-from-the-command-line
24691cb0ef41Sopenharmony_ci[scavenge garbage collector]: https://v8.dev/blog/orinoco-parallel-scavenger
24701cb0ef41Sopenharmony_ci[security warning]: #warning-binding-inspector-to-a-public-ipport-combination-is-insecure
24711cb0ef41Sopenharmony_ci[semi-space]: https://www.memorymanagement.org/glossary/s.html#semi.space
24721cb0ef41Sopenharmony_ci[test reporters]: test.md#test-reporters
24731cb0ef41Sopenharmony_ci[timezone IDs]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
24741cb0ef41Sopenharmony_ci[tracking issue for user-land snapshots]: https://github.com/nodejs/node/issues/44014
24751cb0ef41Sopenharmony_ci[ways that `TZ` is handled in other environments]: https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
2476