1NODE(1)                   BSD General Commands Manual                  NODE(1)
2

NAME

4     node — server-side JavaScript runtime
5

SYNOPSIS

7     node [options] [v8-options] [-e string | script.js | -] [--]
8          [arguments ...]
9     node inspect [-e string | script.js | - | <host>:<port>] ...
10     node [--v8-options]
11

DESCRIPTION

13     Node.js is a set of libraries for JavaScript which allows it to be used
14     outside of the browser.  It is primarily focused on creating simple,
15     easy-to-build network clients and servers.
16
17     Execute node without arguments to start a REPL.
18

OPTIONS

20     -       Alias for stdin, analogous to the use of - in other command-line
21             utilities.  The executed script is read from stdin, and remaining
22             arguments are passed to the script.
23
24     --      Indicate the end of command-line options.  Pass the rest of the
25             arguments to the script.
26
27             If no script filename or eval/print script is supplied prior to
28             this, then the next argument will be used as a script filename.
29
30     --abort-on-uncaught-exception
31             Aborting instead of exiting causes a core file to be generated
32             for analysis.
33
34     --completion-bash
35             Print source-able bash completion script for Node.js.
36
37     --cpu-prof
38             Start the V8 CPU profiler on start up, and write the CPU profile
39             to disk before exit. If --cpu-prof-dir is not specified, the pro‐
40             file will be written to the current working directory with a gen‐
41             erated file name.
42
43     --cpu-prof-dir
44             The directory where the CPU profiles generated by --cpu-prof will
45             be placed.
46
47     --cpu-prof-interval
48             The sampling interval in microseconds for the CPU profiles gener‐
49             ated by --cpu-prof.  The default is 1000.
50
51     --cpu-prof-name
52             File name of the V8 CPU profile generated with --cpu-prof
53
54     --disallow-code-generation-from-strings
55             Make built-in language features like `eval` and `new Function`
56             that generate code from strings throw an exception instead. This
57             does not affect the Node.js `vm` module.
58
59     --enable-fips
60             Enable FIPS-compliant crypto at startup.  Requires Node.js to be
61             built with ./configure --openssl-fips.
62
63     --enable-source-maps
64             Enable experimental Source Map V3 support for stack traces.
65
66     --experimental-import-meta-resolve
67             Enable experimental ES modules support for import.meta.resolve().
68
69     --experimental-json-modules
70             Enable experimental JSON interop support for the ES Module
71             loader.
72
73     --experimental-loader=module
74             Specify the module to use as a custom module loader.
75
76     --experimental-modules
77             Enable experimental ES module support and caching modules.
78
79     --experimental-policy
80             Use the specified file as a security policy.
81
82     --experimental-repl-await
83             Enable experimental top-level await keyword support in REPL.
84
85     --experimental-specifier-resolution
86             Select extension resolution algorithm for ES Modules; either
87             'explicit' (default) or 'node'
88
89     --experimental-report
90             Enable experimental diagnostic report feature.
91
92     --experimental-vm-modules
93             Enable experimental ES module support in VM module.
94
95     --experimental-wasi-unstable-preview1
96             Enable experimental WebAssembly System Interface support.
97
98     --experimental-wasm-modules
99             Enable experimental WebAssembly module support.
100
101     --force-context-aware
102             Disable loading native addons that are not context-aware.
103
104     --force-fips
105             Force FIPS-compliant crypto on startup (Cannot be disabled from
106             script code).  Same requirements as --enable-fips.
107
108     --frozen-intrinsics
109             Enable experimental frozen intrinsics support.
110
111     --heapsnapshot-signal=signal
112             Generate heap snapshot on specified signal.
113
114     --heap-prof
115             Start the V8 heap profiler on start up, and write the heap pro‐
116             file to disk before exit. If --heap-prof-dir is not specified,
117             the profile will be written to the current working directory with
118             a generated file name.
119
120     --heap-prof-dir
121             The directory where the heap profiles generated by --heap-prof
122             will be placed.
123
124     --heap-prof-interval
125             The average sampling interval in bytes for the heap profiles gen‐
126             erated by --heap-prof.  The default is 512 * 1024.
127
128     --heap-prof-name
129             File name of the V8 heap profile generated with --heap-prof
130
131     --http-parser=library
132             Chooses an HTTP parser library. Available values are llhttp or
133             legacy.
134
135     --http-server-default-timeout=milliseconds
136             Overrides the default value for server socket timeout.
137
138     --icu-data-dir=file
139             Specify ICU data load path.  Overrides NODE_ICU_DATA.
140
141     --input-type=type
142             Set the module resolution type for input via --eval, --print or
143             STDIN.
144
145     --inspect-brk=[host:]port
146             Activate inspector on host:port and break at start of user
147             script.
148
149     --inspect-port=[host:]port
150             Set the host:port to be used when the inspector is activated.
151
152     --inspect-publish-uid=stderr,http
153             Specify how the inspector WebSocket URL is exposed.  Valid values
154             are stderr and http.  Default is stderr,http.
155
156     --inspect=[host:]port
157             Activate inspector on host:port.  Default is 127.0.0.1:9229.
158
159             V8 Inspector integration allows attaching Chrome DevTools and
160             IDEs to Node.js instances for debugging and profiling.  It uses
161             the Chrome DevTools Protocol.
162
163     --insecure-http-parser
164             Use an insecure HTTP parser that accepts invalid HTTP headers.
165             This may allow interoperability with non-conformant HTTP imple‐
166             mentations. It may also allow request smuggling and other HTTP
167             attacks that rely on invalid headers being accepted. Avoid using
168             this option.
169
170     --jitless
171             Disable runtime allocation of executable memory. This may be
172             required on some platforms for security reasons. It can also
173             reduce attack surface on other platforms, but the performance
174             impact may be severe.
175
176             This flag is inherited from V8 and is subject to change upstream.
177             It may disappear in a non-semver-major release.
178
179     --max-http-header-size=size
180             Specify the maximum size of HTTP headers in bytes. Defaults to
181             8KB.
182
183     --napi-modules
184             This option is a no-op.  It is kept for compatibility.
185
186     --no-deprecation
187             Silence deprecation warnings.
188
189     --no-force-async-hooks-checks
190             Disable runtime checks for `async_hooks`.  These will still be
191             enabled dynamically when `async_hooks` is enabled.
192
193     --no-warnings
194             Silence all process warnings (including deprecations).
195
196     --openssl-config=file
197             Load an OpenSSL configuration file on startup.  Among other uses,
198             this can be used to enable FIPS-compliant crypto if Node.js is
199             built with ./configure --openssl-fips.
200
201     --pending-deprecation
202             Emit pending deprecation warnings.
203
204     --policy-integrity=sri
205             Instructs Node.js to error prior to running any code if the pol‐
206             icy does not have the specified integrity. It expects a Subre‐
207             source Integrity string as a parameter.
208
209     --preserve-symlinks
210             Instructs the module loader to preserve symbolic links when
211             resolving and caching modules other than the main module.
212
213     --preserve-symlinks-main
214             Instructs the module loader to preserve symbolic links when
215             resolving and caching the main module.
216
217     --prof  Generate V8 profiler output.
218
219     --prof-process
220             Process V8 profiler output generated using the V8 option --prof.
221
222     --redirect-warnings=file
223             Write process warnings to the given file instead of printing to
224             stderr.
225
226     --report-directory
227             Location at which the diagnostic report will be generated.
228
229     --report-filename
230             Name of the file to which the diagnostic report will be written.
231
232     --report-on-fatalerror
233             Enables the diagnostic report to be triggered on fatal errors
234             (internal errors within the Node.js runtime such as out of mem‐
235             ory) that leads to termination of the application, if
236             --experimental-report is enabled. Useful to inspect various diag‐
237             nostic data elements such as heap, stack, event loop state,
238             resource consumption etc. to reason about the fatal error.
239
240     --report-on-signal
241             Enables diagnostic report to be generated upon receiving the
242             specified (or predefined) signal to the running Node.js process,
243             if --experimental-report is enabled. Default signal is SIGUSR2.
244
245     --report-signal
246             Sets or resets the signal for diagnostic report generation (not
247             supported on Windows). Default signal is SIGUSR2.
248
249     --report-uncaught-exception
250             Enables diagnostic report to be generated on un-caught excep‐
251             tions, if --experimental-report is enabled. Useful when inspect‐
252             ing JavaScript stack in conjunction with native stack and other
253             runtime environment data.
254
255     --throw-deprecation
256             Throw errors for deprecations.
257
258     --title=title
259             Specify process.title on startup.
260
261     --tls-cipher-list=list
262             Specify an alternative default TLS cipher list.  Requires Node.js
263             to be built with crypto support. (Default)
264
265     --tls-keylog=file
266             Log TLS key material to a file. The key material is in NSS
267             SSLKEYLOGFILE format and can be used by software (such as Wire‐
268             shark) to decrypt the TLS traffic.
269
270     --tls-max-v1.2
271             Set default  maxVersion to 'TLSv1.2'. Use to disable support for
272             TLSv1.3.
273
274     --tls-max-v1.3
275             Set default  maxVersion to 'TLSv1.3'. Use to enable support for
276             TLSv1.3.
277
278     --tls-min-v1.0
279             Set default minVersion to 'TLSv1'. Use for compatibility with old
280             TLS clients or servers.
281
282     --tls-min-v1.1
283             Set default minVersion to 'TLSv1.1'. Use for compatibility with
284             old TLS clients or servers.
285
286     --tls-min-v1.2
287             Set default minVersion to 'TLSv1.2'. This is the default for 12.x
288             and later, but the option is supported for compatibility with
289             older Node.js versions.
290
291     --tls-min-v1.3
292             Set default minVersion to 'TLSv1.3'. Use to disable support for
293             TLSv1.2 in favour of TLSv1.3, which is more secure.
294
295     --trace-deprecation
296             Print stack traces for deprecations.
297
298     --trace-event-categories categories
299             A comma-separated list of categories that should be traced when
300             trace event tracing is enabled using --trace-events-enabled.
301
302     --trace-event-file-pattern pattern
303             Template string specifying the filepath for the trace event data,
304             it supports ${rotation} and ${pid}.
305
306     --trace-events-enabled
307             Enable the collection of trace event tracing information.
308
309     --trace-exit
310             Prints a stack trace whenever an environment is exited proac‐
311             tively, i.e. invoking `process.exit()`.
312
313     --trace-sync-io
314             Print a stack trace whenever synchronous I/O is detected after
315             the first turn of the event loop.
316
317     --trace-tls
318             Prints TLS packet trace information to stderr.
319
320     --trace-uncaught
321             Print stack traces for uncaught exceptions; usually, the stack
322             trace associated with the creation of an Error is printed,
323             whereas this makes Node.js also print the stack trace associated
324             with throwing the value (which does not need to be an Error
325             instance).
326
327             Enabling this option may affect garbage collection behavior nega‐
328             tively.
329
330     --trace-warnings
331             Print stack traces for process warnings (including deprecations).
332
333     --track-heap-objects
334             Track heap object allocations for heap snapshots.
335
336     ---unhandled-rejections=mode
337             Define the behavior for unhandled rejections. Can be one of
338             `strict` (raise an error), `warn` (enforce warnings) or `none`
339             (silence warnings).
340
341     --use-bundled-ca, --use-openssl-ca
342             Use bundled Mozilla CA store as supplied by current Node.js ver‐
343             sion or use OpenSSL's default CA store.  The default store is
344             selectable at build-time.
345
346             The bundled CA store, as supplied by Node.js, is a snapshot of
347             Mozilla CA store that is fixed at release time.  It is identical
348             on all supported platforms.
349
350             Using OpenSSL store allows for external modifications of the
351             store.  For most Linux and BSD distributions, this store is main‐
352             tained by the distribution maintainers and system administrators.
353             OpenSSL CA store location is dependent on configuration of the
354             OpenSSL library but this can be altered at runtime using environ‐
355             ment variables.
356
357             See SSL_CERT_DIR and SSL_CERT_FILE.
358
359     --v8-options
360             Print V8 command-line options.
361
362     --v8-pool-size=num
363             Set V8's thread pool size which will be used to allocate back‐
364             ground jobs.  If set to 0 then V8 will choose an appropriate size
365             of the thread pool based on the number of online processors.  If
366             the value provided is larger than V8's maximum, then the largest
367             value will be chosen.
368
369     --zero-fill-buffers
370             Automatically zero-fills all newly allocated Buffer and Slow‐
371             Buffer instances.
372
373     -c, --check
374             Check the script's syntax without executing it.  Exits with an
375             error code if script is invalid.
376
377     -e, --eval string
378             Evaluate string as JavaScript.
379
380     -h, --help
381             Print command-line options.  The output of this option is less
382             detailed than this document.
383
384     -i, --interactive
385             Open the REPL even if stdin does not appear to be a terminal.
386
387     -p, --print string
388             Identical to -e, but prints the result.
389
390     -r, --require module
391             Preload the specified module at startup.  Follows `require()`'s
392             module resolution rules.  module may be either a path to a file,
393             or a Node.js module name.
394
395     -v, --version
396             Print node's version.
397

ENVIRONMENT

399     NODE_DEBUG modules...
400             Comma-separated list of core modules that should print debug
401             information.
402
403     NODE_DEBUG_NATIVE modules...
404             Comma-separated list of C++ core modules that should print debug
405             information.
406
407     NODE_DISABLE_COLORS
408             When set to 1, colors will not be used in the REPL.
409
410     NODE_EXTRA_CA_CERTS file
411             When set, the well-known “root” CAs (like VeriSign) will be
412             extended with the extra certificates in file.  The file should
413             consist of one or more trusted certificates in PEM format.
414
415             If file is missing or misformatted, a message will be emitted
416             once using process.emitWarning(), but any errors are otherwise
417             ignored.
418
419             This environment variable is ignored when `node` runs as setuid
420             root or has Linux file capabilities set.
421
422     NODE_ICU_DATA file
423             Data path for ICU (Intl object) data.  Will extend linked-in data
424             when compiled with small-icu support.
425
426     NODE_NO_WARNINGS
427             When set to 1, process warnings are silenced.
428
429     NODE_OPTIONS options...
430             A space-separated list of command-line options, which are inter‐
431             preted as if they had been specified on the command-line before
432             the actual command (so they can be overridden).  Node.js will
433             exit with an error if an option that is not allowed in the envi‐
434             ronment is used, such as --print or a script file.
435
436     NODE_PATH directories...
437             A colon-separated list of directories prefixed to the module
438             search path.
439
440     NODE_PENDING_DEPRECATION
441             When set to 1, emit pending deprecation warnings.
442
443     NODE_PRESERVE_SYMLINKS
444             When set to 1, the module loader preserves symbolic links when
445             resolving and caching modules.
446
447     NODE_REDIRECT_WARNINGS file
448             Write process warnings to the given file instead of printing to
449             stderr.  Equivalent to passing --redirect-warnings file on com‐
450             mand-line.
451
452     NODE_REPL_HISTORY file
453             Path to the file used to store persistent REPL history.  The
454             default path is ~/.node_repl_history, which is overridden by this
455             variable.  Setting the value to an empty string ("" or " ") will
456             disable persistent REPL history.
457
458     NODE_TLS_REJECT_UNAUTHORIZED
459             When set to 0, TLS certificate validation is disabled.
460
461     NODE_V8_COVERAGE dir
462             When set, Node.js writes JavaScript code coverage information to
463             dir.
464
465     OPENSSL_CONF file
466             Load an OpenSSL configuration file on startup.  Among other uses,
467             this can be used to enable FIPS-compliant crypto if Node.js is
468             built with ./configure --openssl-fips.
469
470             If the --openssl-config command-line option is used, this envi‐
471             ronment variable is ignored.
472
473     SSL_CERT_DIR dir
474             If --use-openssl-ca is enabled, this overrides and sets OpenSSL's
475             directory containing trusted certificates.
476
477     SSL_CERT_FILE file
478             If --use-openssl-ca is enabled, this overrides and sets OpenSSL's
479             file containing trusted certificates.
480
481     UV_THREADPOOL_SIZE size
482             Sets the number of threads used in libuv's threadpool to size.
483

BUGS

485     Bugs are tracked in GitHub Issues: https://github.com/nodejs/node/issues
486
488     Copyright Node.js contributors.  Node.js is available under the MIT
489     license.
490
491     Node.js also includes external libraries that are available under a vari‐
492     ety of licenses.  See https://github.com/nodejs/node/blob/master/LICENSE
493     for the full license text.
494

SEE ALSO

496     Website: https://nodejs.org/
497
498     Documentation: https://nodejs.org/api/
499
500     GitHub repository & Issue Tracker: https://github.com/nodejs/node
501
502     IRC (general questions): chat.freenode.net #node.js (unofficial)
503
504     IRC (Node.js core development): chat.freenode.net #node-dev
505

AUTHORS

507     Written and maintained by 1000+ contributors:
508     https://github.com/nodejs/node/blob/master/AUTHORS
509
510                                 May 10, 2020
Impressum