1NODE(1) BSD General Commands Manual NODE(1)
2
4 node — server-side JavaScript runtime
5
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
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
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 --enable-fips
38 Enable FIPS-compliant crypto at startup. Requires Node.js to be
39 built with ./configure --openssl-fips.
40
41 --experimental-modules
42 Enable experimental ES module support and caching modules.
43
44 --experimental-repl-await
45 Enable experimental top-level await keyword support in REPL.
46
47 --experimental-vm-modules
48 Enable experimental ES module support in VM module.
49
50 --experimental-worker
51 Enable experimental worker threads using worker_threads module.
52
53 --force-fips
54 Force FIPS-compliant crypto on startup (Cannot be disabled from
55 script code). Same requirements as --enable-fips.
56
57 --http-parser=library
58 Chooses an HTTP parser library. Available values are llhttp or
59 legacy.
60
61 --icu-data-dir=file
62 Specify ICU data load path. Overrides NODE_ICU_DATA.
63
64 --inspect-brk=[host:]port
65 Activate inspector on host:port and break at start of user
66 script.
67
68 --inspect-port=[host:]port
69 Set the host:port to be used when the inspector is activated.
70
71 --inspect=[host:]port
72 Activate inspector on host:port. Default is 127.0.0.1:9229.
73
74 V8 Inspector integration allows attaching Chrome DevTools and
75 IDEs to Node.js instances for debugging and profiling. It uses
76 the Chrome DevTools Protocol.
77
78 --loader=file
79 Specify the file as a custom loader, to load
80 --experimental-modules.
81
82 --max-http-header-size=size
83 Specify the maximum size of HTTP headers in bytes. Defaults to
84 8KB.
85
86 --napi-modules
87 This option is a no-op. It is kept for compatibility.
88
89 --no-deprecation
90 Silence deprecation warnings.
91
92 --no-force-async-hooks-checks
93 Disable runtime checks for `async_hooks`. These will still be
94 enabled dynamically when `async_hooks` is enabled.
95
96 --no-warnings
97 Silence all process warnings (including deprecations).
98
99 --openssl-config=file
100 Load an OpenSSL configuration file on startup. Among other uses,
101 this can be used to enable FIPS-compliant crypto if Node.js is
102 built with ./configure --openssl-fips.
103
104 --pending-deprecation
105 Emit pending deprecation warnings.
106
107 --preserve-symlinks
108 Instructs the module loader to preserve symbolic links when
109 resolving and caching modules other than the main module.
110
111 --preserve-symlinks-main
112 Instructs the module loader to preserve symbolic links when
113 resolving and caching the main module.
114
115 --prof Generate V8 profiler output.
116
117 --prof-process
118 Process V8 profiler output generated using the V8 option --prof.
119
120 --redirect-warnings=file
121 Write process warnings to the given file instead of printing to
122 stderr.
123
124 --throw-deprecation
125 Throw errors for deprecations.
126
127 --title=title
128 Specify process.title on startup.
129
130 --tls-cipher-list=list
131 Specify an alternative default TLS cipher list. Requires Node.js
132 to be built with crypto support. (Default)
133
134 --trace-deprecation
135 Print stack traces for deprecations.
136
137 --trace-event-categories categories
138 A comma-separated list of categories that should be traced when
139 trace event tracing is enabled using --trace-events-enabled.
140
141 --trace-event-file-pattern pattern
142 Template string specifying the filepath for the trace event data,
143 it supports ${rotation} and ${pid}.
144
145 --trace-events-enabled
146 Enable the collection of trace event tracing information.
147
148 --trace-sync-io
149 Print a stack trace whenever synchronous I/O is detected after
150 the first turn of the event loop.
151
152 --trace-warnings
153 Print stack traces for process warnings (including deprecations).
154
155 --track-heap-objects
156 Track heap object allocations for heap snapshots.
157
158 --use-bundled-ca, --use-openssl-ca
159 Use bundled Mozilla CA store as supplied by current Node.js ver‐
160 sion or use OpenSSL's default CA store. The default store is
161 selectable at build-time.
162
163 The bundled CA store, as supplied by Node.js, is a snapshot of
164 Mozilla CA store that is fixed at release time. It is identical
165 on all supported platforms.
166
167 Using OpenSSL store allows for external modifications of the
168 store. For most Linux and BSD distributions, this store is main‐
169 tained by the distribution maintainers and system administrators.
170 OpenSSL CA store location is dependent on configuration of the
171 OpenSSL library but this can be altered at runtime using environ‐
172 ment variables.
173
174 See SSL_CERT_DIR and SSL_CERT_FILE.
175
176 --v8-options
177 Print V8 command-line options.
178
179 --v8-pool-size=num
180 Set V8's thread pool size which will be used to allocate back‐
181 ground jobs. If set to 0 then V8 will choose an appropriate size
182 of the thread pool based on the number of online processors. If
183 the value provided is larger than V8's maximum, then the largest
184 value will be chosen.
185
186 --zero-fill-buffers
187 Automatically zero-fills all newly allocated Buffer and Slow‐
188 Buffer instances.
189
190 -c, --check
191 Check the script's syntax without executing it. Exits with an
192 error code if script is invalid.
193
194 -e, --eval string
195 Evaluate string as JavaScript.
196
197 -h, --help
198 Print command-line options. The output of this option is less
199 detailed than this document.
200
201 -i, --interactive
202 Open the REPL even if stdin does not appear to be a terminal.
203
204 -p, --print string
205 Identical to -e, but prints the result.
206
207 -r, --require module
208 Preload the specified module at startup. Follows `require()`'s
209 module resolution rules. module may be either a path to a file,
210 or a Node.js module name.
211
212 -v, --version
213 Print node's version.
214
216 NODE_DEBUG modules...
217 Comma-separated list of core modules that should print debug
218 information.
219
220 NODE_DEBUG_NATIVE modules...
221 Comma-separated list of C++ core modules that should print debug
222 information.
223
224 NODE_DISABLE_COLORS
225 When set to 1, colors will not be used in the REPL.
226
227 NODE_EXTRA_CA_CERTS file
228 When set, the well-known “root” CAs (like VeriSign) will be
229 extended with the extra certificates in file. The file should
230 consist of one or more trusted certificates in PEM format.
231
232 If file is missing or misformatted, a message will be emitted
233 once using process.emitWarning(), but any errors are otherwise
234 ignored.
235
236 This environment variable is ignored when `node` runs as setuid
237 root or has Linux file capabilities set.
238
239 NODE_ICU_DATA file
240 Data path for ICU (Intl object) data. Will extend linked-in data
241 when compiled with small-icu support.
242
243 NODE_NO_WARNINGS
244 When set to 1, process warnings are silenced.
245
246 NODE_OPTIONS options...
247 A space-separated list of command-line options, which are inter‐
248 preted as if they had been specified on the command-line before
249 the actual command (so they can be overridden). Node.js will
250 exit with an error if an option that is not allowed in the envi‐
251 ronment is used, such as --print or a script file.
252
253 NODE_PATH directories...
254 A colon-separated list of directories prefixed to the module
255 search path.
256
257 NODE_PENDING_DEPRECATION
258 When set to 1, emit pending deprecation warnings.
259
260 NODE_PRESERVE_SYMLINKS
261 When set to 1, the module loader preserves symbolic links when
262 resolving and caching modules.
263
264 NODE_REDIRECT_WARNINGS file
265 Write process warnings to the given file instead of printing to
266 stderr. Equivalent to passing --redirect-warnings file on com‐
267 mand-line.
268
269 NODE_REPL_HISTORY file
270 Path to the file used to store persistent REPL history. The
271 default path is ~/.node_repl_history, which is overridden by this
272 variable. Setting the value to an empty string ("" or " ") will
273 disable persistent REPL history.
274
275 NODE_TLS_REJECT_UNAUTHORIZED
276 When set to 0, TLS certificate validation is disabled.
277
278 NODE_V8_COVERAGE dir
279 When set, Node.js writes JavaScript code coverage information to
280 dir.
281
282 OPENSSL_CONF file
283 Load an OpenSSL configuration file on startup. Among other uses,
284 this can be used to enable FIPS-compliant crypto if Node.js is
285 built with ./configure --openssl-fips.
286
287 If the --openssl-config command-line option is used, this envi‐
288 ronment variable is ignored.
289
290 SSL_CERT_DIR dir
291 If --use-openssl-ca is enabled, this overrides and sets OpenSSL's
292 directory containing trusted certificates.
293
294 SSL_CERT_FILE file
295 If --use-openssl-ca is enabled, this overrides and sets OpenSSL's
296 file containing trusted certificates.
297
298 UV_THREADPOOL_SIZE size
299 Sets the number of threads used in libuv's threadpool to size.
300
302 Bugs are tracked in GitHub Issues: https://github.com/nodejs/node/issues
303
305 Copyright Node.js contributors. Node.js is available under the MIT
306 license.
307
308 Node.js also includes external libraries that are available under a vari‐
309 ety of licenses. See https://github.com/nodejs/node/blob/master/LICENSE
310 for the full license text.
311
313 Website: https://nodejs.org/
314
315 Documentation: https://nodejs.org/api/
316
317 GitHub repository & Issue Tracker: https://github.com/nodejs/node
318
319 IRC (general questions): chat.freenode.net #node.js (unofficial)
320
321 IRC (Node.js core development): chat.freenode.net #node-dev
322
324 Written and maintained by 1000+ contributors:
325 https://github.com/nodejs/node/blob/master/AUTHORS
326
327 June 20, 2019