Skip to content

Commit 4fde666

Browse files
committed
doc: add more missing environment variables to manpage
1 parent f5da8f8 commit 4fde666

File tree

2 files changed

+169
-37
lines changed

2 files changed

+169
-37
lines changed

doc/node.1

Lines changed: 169 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ Allow execution of WASI when using the permission model.
9494
.It Fl -allow-worker
9595
Allow creating worker threads when using the permission model.
9696
.
97+
.It Fl -build-snapshot
98+
Generates a snapshot blob when the process exits and writes it to disk, which can be loaded later with
99+
.Sy --snapshot-blob.
100+
.
101+
.It Fl build-snapshot-config
102+
Specifies the path to a JSON configuration file which configures snapshot creation behavior.
103+
.
97104
.It Fl -completion-bash
98105
Print source-able bash completion script for Node.js.
99106
.
@@ -145,6 +152,15 @@ is `delete`, the property will be removed entirely. If
145152
is `throw`, accesses to the property will throw an exception with the code
146153
`ERR_PROTO_ACCESS`.
147154
.
155+
.It Fl -disable-sigusr1
156+
Disable the ability of starting a debugging session by sending a SIGUSR1 signal to the process.
157+
.
158+
.It Fl disable-warning Ns = Ns Ar code-or-type
159+
Disable specific process warnings by
160+
.Ar code
161+
or
162+
.Ar type .
163+
.
148164
.It Fl -disable-wasm-trap-handler Ns = Ns Ar mode
149165
Disable trap-handler-based WebAssembly bound checks and fall back to
150166
inline bound checks so that WebAssembly can be run with limited virtual
@@ -155,17 +171,36 @@ Make built-in language features like `eval` and `new Function` that generate
155171
code from strings throw an exception instead. This does not affect the Node.js
156172
`vm` module.
157173
.
174+
.It Fl -dns-result-order Ns = Ns Ar order
175+
Set the default value of order in
176+
.Ar dns.lookup()
177+
and
178+
.Ar dnsPromises.lookup() .
179+
.
158180
.It Fl -enable-fips
159181
Enable FIPS-compliant crypto at startup.
160182
Requires Node.js to be built with
161183
.Sy ./configure --openssl-fips .
162184
.
185+
.It Fl -enable-network-family-autoselection
186+
Enables the family autoselection algorithm unless connection options explicitly disables it.
187+
.
163188
.It Fl -enable-source-maps
164189
Enable Source Map V3 support for stack traces.
165190
.
166191
.It Fl -entry-url
167192
Interpret the entry point as a URL.
168193
.
194+
.It Fl -env-file-if-exists Ns = Ns Ar config
195+
Behavior is the same as
196+
.Ar --env-file
197+
,
198+
but an error is not thrown if the file does not exist.
199+
.
200+
.It Fl env-file Ns = Ns Ar config
201+
Loads environment variables from a file relative to the current directory, making them available to applications on
202+
.Sy process.env .
203+
.
169204
.It Fl -experimental-addon-modules
170205
Enable experimental addon module support.
171206
.
@@ -183,6 +218,20 @@ Specify the
183218
.Ar module
184219
to use as a custom module loader.
185220
.
221+
.It Fl -experimental-network-inspection
222+
Enable experimental support for the network inspection with Chrome DevTools.
223+
.
224+
.It Fl -experimental-print-required-tla
225+
If the ES module being
226+
.Sy require()'d
227+
contains top-level await, this flag allows Node.js to evaluate the module, try to locate the top-level awaits, and print their location to help users find them.
228+
.
229+
.It Fl -experimental-require-module
230+
Supports loading a synchronous ES module graph in require().
231+
.
232+
.It Fl -experimental-sea-config
233+
Use this flag to generate a blob that can be injected into the Node.js binary to produce a single executable application.
234+
.
186235
.It Fl -permission
187236
Enable the permission model.
188237
.
@@ -207,9 +256,15 @@ Disable experimental support for the WebSocket API.
207256
.It Fl -experimental-webstorage
208257
Enable experimental support for the Web Storage API.
209258
.
259+
.It Fl -experimental-worker-inspection
260+
Enable experimental support for the worker inspection with Chrome DevTools.
261+
.
210262
.It Fl -no-experimental-repl-await
211263
Disable top-level await keyword support in REPL.
212264
.
265+
.It Fl -no-experimental-require-module
266+
Disable support for loading a synchronous ES module graph in require().
267+
.
213268
.It Fl -no-experimental-sqlite
214269
Disable the experimental node:sqlite module.
215270
.
@@ -238,6 +293,11 @@ Force FIPS-compliant crypto on startup
238293
Same requirements as
239294
.Fl -enable-fips .
240295
.
296+
.It Fl -force-node-api-uncaught-exceptions-policy
297+
Enforces
298+
.Sy uncaughtException
299+
event on Node-API asynchronous callbacks.
300+
.
241301
.It Fl -frozen-intrinsics
242302
Enable experimental frozen intrinsics support.
243303
.
@@ -278,6 +338,10 @@ Specify ICU data load path.
278338
Overrides
279339
.Ev NODE_ICU_DATA .
280340
.
341+
.It Fl -import Ns = Ns Ar module
342+
Preload the specified module at startup. If the flag is provided several times, each module will be executed sequentially in the order they appear, starting with the ones provided in
343+
.Ar NODE_OPTIONS .
344+
.
281345
.It Fl -input-type Ns = Ns Ar type
282346
Set the module resolution type for input via --eval, --print or STDIN.
283347
.
@@ -339,9 +403,22 @@ Specify the maximum size of HTTP headers in bytes. Defaults to 16 KiB.
339403
This option is a no-op.
340404
It is kept for compatibility.
341405
.
406+
.It Fl -network-family-autoselection-attempt-timeout
407+
Sets the default value for the network family autoselection attempt timeout.
408+
.
342409
.It Fl -no-deprecation
343410
Silence deprecation warnings.
344411
.
412+
.It Fl -no-experimental-detect-module
413+
Disable using
414+
.Ar syntax detection
415+
to determine module type.
416+
.
417+
.It Fl -no-experimental-global-navigator
418+
Disable exposition of
419+
.Ar Navigator API
420+
on the global scope.
421+
.
345422
.It Fl -no-extra-info-on-fatal-exception
346423
Hide extra information on fatal exception that causes exit.
347424
.
@@ -354,9 +431,19 @@ Disable the `node-addons` exports condition as well as disable loading native
354431
addons. When `--no-addons` is specified, calling `process.dlopen` or requiring
355432
a native C++ addon will fail and throw an exception.
356433
.
434+
.It Fl -no-async-context-frame
435+
Disables the use of
436+
.Sy AsyncLocalStorage
437+
backed by
438+
.Sy AsyncContextFrame
439+
and uses the prior implementation which relied on async_hooks.
440+
.
357441
.It Fl -no-global-search-paths
358442
Do not search modules from global paths.
359443
.
444+
.It Fl -no-network-family-autoselection
445+
Disables the family autoselection algorithm unless connection options explicitly enables it.
446+
.
360447
.It Fl -no-warnings
361448
Silence all process warnings (including deprecations).
362449
.
@@ -369,6 +456,14 @@ Load an OpenSSL configuration file on startup.
369456
Among other uses, this can be used to enable FIPS-compliant crypto if Node.js is built with
370457
.Sy ./configure --openssl-fips .
371458
.
459+
.It Fl -openssl-legacy-provider
460+
Enable OpenSSL 3.0 legacy provider.
461+
.
462+
.It Fl -openssl-shared-config
463+
Enable OpenSSL default configuration section,
464+
.Sy openssl_conf
465+
to be read from the OpenSSL configuration file.
466+
.
372467
.It Fl -pending-deprecation
373468
Emit pending deprecation warnings.
374469
.
@@ -404,6 +499,18 @@ be written to is controlled by the
404499
.Fl -diagnostic-dir .
405500
command-line option.
406501
.
502+
.It Fl -report-exclude-env
503+
When
504+
.Sy --report-exclude-env
505+
is passed the diagnostic report generated will not contain the
506+
.Sy environmentVariables
507+
data.
508+
.
509+
.It Fl -report-exclude-network
510+
Exclude
511+
.Sy header.networkInterfaces
512+
from the diagnostic report. By default this is not set and the network interfaces are included.
513+
.
407514
.It Fl -report-filename
408515
Name of the file to which the
409516
.Sy diagnostic report
@@ -441,6 +548,19 @@ the secure heap. The default is 0. The value must be a power of two.
441548
.It Fl -secure-heap-min Ns = Ns Ar n
442549
Specify the minimum allocation from the OpenSSL secure heap. The default is 2. The value must be a power of two.
443550
.
551+
.It Fl -snapshot-blob Ns = Ns Ar path
552+
When used with
553+
.Sy --build-snapshot,
554+
.Sy --snapshot-blob
555+
specifies the path where the generated snapshot blob is written to. If not specified, the generated blob is written to
556+
.Sy snapshot.blob
557+
in the current working directory.
558+
.Pp
559+
When used without
560+
.Sy --build-snapshot,
561+
.Sy --snapshot-blob
562+
specifies the path to the blob that is used to restore the application state.
563+
.
444564
.It Fl -test
445565
Starts the Node.js command line test runner.
446566
.
@@ -540,6 +660,15 @@ favour of TLSv1.3, which is more secure.
540660
.It Fl -trace-deprecation
541661
Print stack traces for deprecations.
542662
.
663+
.It Fl -trace-env
664+
Print information about any access to environment variables done in the current Node.js instance to stderr.
665+
.
666+
.It Fl -trace-env-js-stack
667+
In addition to what --trace-env does, this prints the JavaScript stack trace of the access.
668+
.
669+
.It Fl -trace-env-native-stack
670+
In addition to what --trace-env does, this prints the native stack trace of the access.
671+
.
543672
.It Fl -trace-event-categories Ar categories
544673
A comma-separated list of categories that should be traced when trace event tracing is enabled using
545674
.Fl -trace-events-enabled .
@@ -557,6 +686,23 @@ Enable the collection of trace event tracing information.
557686
.It Fl -trace-exit
558687
Prints a stack trace whenever an environment is exited proactively,
559688
i.e. invoking `process.exit()`.
689+
.
690+
.It Fl -trace-require-module Ns = Ns Ar mode
691+
Prints information about usage of
692+
.Sy Loading ECMAScript modules using require() .
693+
.Pp
694+
When
695+
.Sy mode
696+
is
697+
.Sy all
698+
, all usage is printed. When
699+
.Sy mode
700+
is
701+
.Sy no-node-modules
702+
, usage from
703+
.Sy the node_modules
704+
folder is excluded.
705+
.
560706
.It Fl -trace-sigint
561707
Prints a stack trace on SIGINT.
562708
.
@@ -613,6 +759,17 @@ must have one of the following values:
613759
`off` (the default value, meaning do not map), `on` (map and ignore failure,
614760
reporting it to stderr), or `silent` (map and silently ignore failure).
615761
.
762+
.It Fl -use-system-ca
763+
Node.js uses the trusted CA certificates present in the system store along with the
764+
.Sy --use-bundled-ca
765+
option and the
766+
.Sy NODE_EXTRA_CA_CERTS
767+
environment variable.
768+
.Pp
769+
On platforms other than Windows and macOS, this loads certificates from the directory and file trusted by OpenSSL, similar to
770+
.Sy --use-openssl-ca
771+
, with the difference being that it caches the certificates after first load.
772+
.
616773
.It Fl -v8-options
617774
Print V8 command-line options.
618775
.
@@ -623,14 +780,17 @@ If the value provided is larger than V8's maximum, then the largest value will b
623780
.
624781
.It Fl -watch
625782
Starts Node.js in watch mode. When in watch mode, changes in the watched files cause the Node.js process to restart.
626-
783+
.Pp
627784
By default, watch mode will watch the entry point and any required or imported module. Use --watch-path to specify what paths to watch.
628785
.
629786
.It Fl -watch-path
630787
Starts Node.js in watch mode and specifies what paths to watch. When in watch mode, changes in the watched paths cause the Node.js process to restart.
631-
788+
.Pp
632789
This will turn off watching of required or imported modules, even when used in combination with --watch.
633790
.
791+
.It Fl -watch-preserve-output
792+
Disable the clearing of the console when watch mode restarts the process.
793+
.
634794
.It Fl -watch-kill-signal
635795
Customizes the signal sent to the process on watch mode restarts.
636796
.
@@ -666,6 +826,13 @@ Follows `require()`'s module resolution rules.
666826
.Ar module
667827
may be either a path to a file, or a Node.js module name.
668828
.
829+
.It Fl -run
830+
This runs a specified command from a package.json's
831+
.Sy "scripts"
832+
object. If a missing
833+
.Sy "command"
834+
is provided, it will list the available scripts.
835+
.
669836
.It Fl v , Fl -version
670837
Print node's version.
671838
.El

test/parallel/test-cli-node-cli-manpage-options.mjs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,42 +21,7 @@ const manPageContents = readFileSync(manPagePath, { encoding: 'utf8' });
2121
// TODO(dario-piotrowicz): add the missing flags to the node.1 and remove this set
2222
// (refs: https://github.com/nodejs/node/issues/58895)
2323
const knownFlagsMissingFromManPage = new Set([
24-
'build-snapshot',
25-
'build-snapshot-config',
26-
'disable-sigusr1',
27-
'disable-warning',
28-
'dns-result-order',
29-
'enable-network-family-autoselection',
30-
'env-file-if-exists',
31-
'env-file',
32-
'experimental-network-inspection',
33-
'experimental-print-required-tla',
34-
'experimental-require-module',
35-
'experimental-sea-config',
36-
'experimental-worker-inspection',
3724
'expose-gc',
38-
'force-node-api-uncaught-exceptions-policy',
39-
'import',
40-
'network-family-autoselection-attempt-timeout',
41-
'no-async-context-frame',
42-
'no-experimental-detect-module',
43-
'no-experimental-global-navigator',
44-
'no-experimental-require-module',
45-
'no-network-family-autoselection',
46-
'openssl-legacy-provider',
47-
'openssl-shared-config',
48-
'report-dir',
49-
'report-directory',
50-
'report-exclude-env',
51-
'report-exclude-network',
52-
'run',
53-
'snapshot-blob',
54-
'trace-env',
55-
'trace-env-js-stack',
56-
'trace-env-native-stack',
57-
'trace-require-module',
58-
'use-system-ca',
59-
'watch-preserve-output',
6025
]);
6126

6227
const optionsEncountered = { dash: 0, dashDash: 0, named: 0 };

0 commit comments

Comments
 (0)