Lines Matching +full:code +full:-
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width">
6 <meta name="nodejs.org:node-version" content="v18.20.1">
7 <title>Command-line API | Node.js v18.20.1 Documentation</title>
15 <body class="alt apidoc" id="api-section-cli">
24 <li><a href="documentation.html" class="nav-documentation">About this documentation</a></li>
25 <li><a href="synopsis.html" class="nav-synopsis">Usage and example</a></li>
29 <li><a href="assert.html" class="nav-assert">Assertion testing</a></li>
30 <li><a href="async_context.html" class="nav-async_context">Asynchronous context tracking</a></li>
31 <li><a href="async_hooks.html" class="nav-async_hooks">Async hooks</a></li>
32 <li><a href="buffer.html" class="nav-buffer">Buffer</a></li>
33 <li><a href="addons.html" class="nav-addons">C++ addons</a></li>
34 <li><a href="n-api.html" class="nav-n-api">C/C++ addons with Node-API</a></li>
35 <li><a href="embedding.html" class="nav-embedding">C++ embedder API</a></li>
36 <li><a href="child_process.html" class="nav-child_process">Child processes</a></li>
37 <li><a href="cluster.html" class="nav-cluster">Cluster</a></li>
38 <li><a href="cli.html" class="nav-cli active">Command-line options</a></li>
39 <li><a href="console.html" class="nav-console">Console</a></li>
40 <li><a href="corepack.html" class="nav-corepack">Corepack</a></li>
41 <li><a href="crypto.html" class="nav-crypto">Crypto</a></li>
42 <li><a href="debugger.html" class="nav-debugger">Debugger</a></li>
43 <li><a href="deprecations.html" class="nav-deprecations">Deprecated APIs</a></li>
44 <li><a href="diagnostics_channel.html" class="nav-diagnostics_channel">Diagnostics Channel</a></li>
45 <li><a href="dns.html" class="nav-dns">DNS</a></li>
46 <li><a href="domain.html" class="nav-domain">Domain</a></li>
47 <li><a href="errors.html" class="nav-errors">Errors</a></li>
48 <li><a href="events.html" class="nav-events">Events</a></li>
49 <li><a href="fs.html" class="nav-fs">File system</a></li>
50 <li><a href="globals.html" class="nav-globals">Globals</a></li>
51 <li><a href="http.html" class="nav-http">HTTP</a></li>
52 <li><a href="http2.html" class="nav-http2">HTTP/2</a></li>
53 <li><a href="https.html" class="nav-https">HTTPS</a></li>
54 <li><a href="inspector.html" class="nav-inspector">Inspector</a></li>
55 <li><a href="intl.html" class="nav-intl">Internationalization</a></li>
56 <li><a href="modules.html" class="nav-modules">Modules: CommonJS modules</a></li>
57 <li><a href="esm.html" class="nav-esm">Modules: ECMAScript modules</a></li>
58 <li><a href="module.html" class="nav-module">Modules: <code>node:module</code> API</a></li>
59 <li><a href="packages.html" class="nav-packages">Modules: Packages</a></li>
60 <li><a href="net.html" class="nav-net">Net</a></li>
61 <li><a href="os.html" class="nav-os">OS</a></li>
62 <li><a href="path.html" class="nav-path">Path</a></li>
63 <li><a href="perf_hooks.html" class="nav-perf_hooks">Performance hooks</a></li>
64 <li><a href="permissions.html" class="nav-permissions">Permissions</a></li>
65 <li><a href="process.html" class="nav-process">Process</a></li>
66 <li><a href="punycode.html" class="nav-punycode">Punycode</a></li>
67 <li><a href="querystring.html" class="nav-querystring">Query strings</a></li>
68 <li><a href="readline.html" class="nav-readline">Readline</a></li>
69 <li><a href="repl.html" class="nav-repl">REPL</a></li>
70 <li><a href="report.html" class="nav-report">Report</a></li>
71 <li><a href="single-executable-applications.html" class="nav-single-executable-applications">Single…
72 <li><a href="stream.html" class="nav-stream">Stream</a></li>
73 <li><a href="string_decoder.html" class="nav-string_decoder">String decoder</a></li>
74 <li><a href="test.html" class="nav-test">Test runner</a></li>
75 <li><a href="timers.html" class="nav-timers">Timers</a></li>
76 <li><a href="tls.html" class="nav-tls">TLS/SSL</a></li>
77 <li><a href="tracing.html" class="nav-tracing">Trace events</a></li>
78 <li><a href="tty.html" class="nav-tty">TTY</a></li>
79 <li><a href="dgram.html" class="nav-dgram">UDP/datagram</a></li>
80 <li><a href="url.html" class="nav-url">URL</a></li>
81 <li><a href="util.html" class="nav-util">Utilities</a></li>
82 <li><a href="v8.html" class="nav-v8">V8</a></li>
83 <li><a href="vm.html" class="nav-vm">VM</a></li>
84 <li><a href="wasi.html" class="nav-wasi">WASI</a></li>
85 <li><a href="webcrypto.html" class="nav-webcrypto">Web Crypto API</a></li>
86 <li><a href="webstreams.html" class="nav-webstreams">Web Streams API</a></li>
87 <li><a href="worker_threads.html" class="nav-worker_threads">Worker threads</a></li>
88 <li><a href="zlib.html" class="nav-zlib">Zlib</a></li>
92 <li><a href="https://github.com/nodejs/node" class="nav-https-github-com-nodejs-node">Code reposito…
96 <div id="column1" data-id="cli" class="interior">
98 <div class="header-container">
100 …<button class="theme-toggle-btn" id="theme-toggle-btn" title="Toggle dark mode/light mode" aria-la…
101 <svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" height="24" width="24">
103 …-2.33-4.51-.5-8.48.53-10.07C6.27 2.2 1.98 6.59 1.98 12c0 .14.02.28.02.42.62-.27 1.29-.42 2-.42 1.6…
104 …<path d="M7 16h-.18C6.4 14.84 5.3 14 4 14c-1.66 0-3 1.34-3 3s1.34 3 3 3h3c1.1 0 2-.9 2-2s-.9-2-2-2…
106 <svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" height="24" width="24">
108 …-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.4…
114 <li class="pinned-header">Node.js v18.20.1</li>
116 <li class="picker-header">
118 <span class="collapsed-arrow">►</span><span class="expanded-arrow">▼</span>
123 <li><a href="#command-line-api">Command-line API</a>
126 <li><a href="#program-entry-point">Program entry point</a>
128 <li><a href="#ecmascript-modules-loader-entry-point-caveat">ECMAScript modules loader entry point c…
133 <li><a href="#-"><code>-</code></a></li>
134 <li><a href="#--"><code>--</code></a></li>
135 <li><a href="#--abort-on-uncaught-exception"><code>--abort-on-uncaught-exception</code></a></li>
136 <li><span class="stability_1"><a href="#--build-snapshot"><code>--build-snapshot</code></a></span><…
137 <li><a href="#--completion-bash"><code>--completion-bash</code></a></li>
138 …ass="stability_1"><a href="#-c-condition---conditionscondition"><code>-C condition</code>, <code>-…
139 <li><span class="stability_1"><a href="#--cpu-prof"><code>--cpu-prof</code></a></span></li>
140 <li><span class="stability_1"><a href="#--cpu-prof-dir"><code>--cpu-prof-dir</code></a></span></li>
141 <li><span class="stability_1"><a href="#--cpu-prof-interval"><code>--cpu-prof-interval</code></a></…
142 <li><span class="stability_1"><a href="#--cpu-prof-name"><code>--cpu-prof-name</code></a></span></l…
143 <li><a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir=directory</code></a></li>
144 <li><a href="#--disable-protomode"><code>--disable-proto=mode</code></a></li>
145 <li><a href="#--disallow-code-generation-from-strings"><code>--disallow-code-generation-from-string…
146 <li><a href="#--dns-result-orderorder"><code>--dns-result-order=order</code></a></li>
147 <li><a href="#--enable-fips"><code>--enable-fips</code></a></li>
148 <li><a href="#--enable-network-family-autoselection"><code>--enable-network-family-autoselection</c…
149 <li><a href="#--enable-source-maps"><code>--enable-source-maps</code></a></li>
150 <li><a href="#--experimental-global-customevent"><code>--experimental-global-customevent</code></a>…
151 <li><a href="#--experimental-global-webcrypto"><code>--experimental-global-webcrypto</code></a></li>
152 …i><span class="stability_1"><a href="#--experimental-default-typetype"><code>--experimental-defaul…
153 <li><a href="#--experimental-import-meta-resolve"><code>--experimental-import-meta-resolve</code></…
154 <li><a href="#--experimental-loadermodule"><code>--experimental-loader=module</code></a></li>
155 …li><span class="stability_1"><a href="#--experimental-network-imports"><code>--experimental-networ…
156 <li><a href="#--experimental-policy"><code>--experimental-policy</code></a></li>
157 <li><a href="#--no-experimental-fetch"><code>--no-experimental-fetch</code></a></li>
158 <li><a href="#--no-experimental-repl-await"><code>--no-experimental-repl-await</code></a></li>
159 <li><a href="#--experimental-shadow-realm"><code>--experimental-shadow-realm</code></a></li>
160 <li><a href="#--experimental-specifier-resolutionmode"><code>--experimental-specifier-resolution=mo…
161 <li><a href="#--experimental-test-coverage"><code>--experimental-test-coverage</code></a></li>
162 <li><a href="#--experimental-vm-modules"><code>--experimental-vm-modules</code></a></li>
163 <li><a href="#--experimental-wasi-unstable-preview1"><code>--experimental-wasi-unstable-preview1</c…
164 <li><a href="#--experimental-wasm-modules"><code>--experimental-wasm-modules</code></a></li>
165 <li><a href="#--force-context-aware"><code>--force-context-aware</code></a></li>
166 <li><a href="#--force-fips"><code>--force-fips</code></a></li>
167 <li><span class="stability_1"><a href="#--frozen-intrinsics"><code>--frozen-intrinsics</code></a></…
168 <li><a href="#--force-node-api-uncaught-exceptions-policy"><code>--force-node-api-uncaught-exceptio…
169 …class="stability_1"><a href="#--heapsnapshot-near-heap-limitmax_count"><code>--heapsnapshot-near-h…
170 <li><a href="#--heapsnapshot-signalsignal"><code>--heapsnapshot-signal=signal</code></a></li>
171 <li><span class="stability_1"><a href="#--heap-prof"><code>--heap-prof</code></a></span></li>
172 <li><span class="stability_1"><a href="#--heap-prof-dir"><code>--heap-prof-dir</code></a></span></l…
173 <li><span class="stability_1"><a href="#--heap-prof-interval"><code>--heap-prof-interval</code></a>…
174 <li><span class="stability_1"><a href="#--heap-prof-name"><code>--heap-prof-name</code></a></span><…
175 <li><a href="#--icu-data-dirfile"><code>--icu-data-dir=file</code></a></li>
176 <li><span class="stability_1"><a href="#--importmodule"><code>--import=module</code></a></span></li>
177 <li><a href="#--input-typetype"><code>--input-type=type</code></a></li>
178 <li><a href="#--inspect-brkhostport"><code>--inspect-brk[=[host:]port]</code></a></li>
179 <li><a href="#--inspect-porthostport"><code>--inspect-port=[host:]port</code></a></li>
180 <li><a href="#--inspecthostport"><code>--inspect[=[host:]port]</code></a>
182 <li><a href="#warning-binding-inspector-to-a-public-ipport-combination-is-insecure">Warning: bindin…
185 <li><a href="#--inspect-publish-uidstderrhttp"><code>--inspect-publish-uid=stderr,http</code></a></…
186 <li><a href="#--insecure-http-parser"><code>--insecure-http-parser</code></a></li>
187 <li><a href="#--jitless"><code>--jitless</code></a></li>
188 <li><a href="#--max-http-header-sizesize"><code>--max-http-header-size=size</code></a></li>
189 <li><a href="#--napi-modules"><code>--napi-modules</code></a></li>
190 <li><a href="#--no-addons"><code>--no-addons</code></a></li>
191 <li><a href="#--no-deprecation"><code>--no-deprecation</code></a></li>
192 <li><a href="#--no-extra-info-on-fatal-exception"><code>--no-extra-info-on-fatal-exception</code></…
193 <li><a href="#--no-force-async-hooks-checks"><code>--no-force-async-hooks-checks</code></a></li>
194 <li><a href="#--no-global-search-paths"><code>--no-global-search-paths</code></a></li>
195 <li><a href="#--no-warnings"><code>--no-warnings</code></a></li>
196 <li><a href="#--node-memory-debug"><code>--node-memory-debug</code></a></li>
197 <li><a href="#--openssl-configfile"><code>--openssl-config=file</code></a></li>
198 <li><a href="#--openssl-shared-config"><code>--openssl-shared-config</code></a></li>
199 <li><a href="#--openssl-legacy-provider"><code>--openssl-legacy-provider</code></a></li>
200 <li><a href="#--pending-deprecation"><code>--pending-deprecation</code></a></li>
201 <li><span class="stability_1"><a href="#--policy-integritysri"><code>--policy-integrity=sri</code><…
202 <li><a href="#--preserve-symlinks"><code>--preserve-symlinks</code></a></li>
203 <li><a href="#--preserve-symlinks-main"><code>--preserve-symlinks-main</code></a></li>
204 <li><a href="#--prof"><code>--prof</code></a></li>
205 <li><a href="#--prof-process"><code>--prof-process</code></a></li>
206 <li><a href="#--redirect-warningsfile"><code>--redirect-warnings=file</code></a></li>
207 <li><a href="#--report-compact"><code>--report-compact</code></a></li>
208 <li><a href="#--report-dirdirectory-report-directorydirectory"><code>--report-dir=directory</code>,…
209 <li><a href="#--report-filenamefilename"><code>--report-filename=filename</code></a></li>
210 <li><a href="#--report-on-fatalerror"><code>--report-on-fatalerror</code></a></li>
211 <li><a href="#--report-on-signal"><code>--report-on-signal</code></a></li>
212 <li><a href="#--report-signalsignal"><code>--report-signal=signal</code></a></li>
213 <li><a href="#--report-uncaught-exception"><code>--report-uncaught-exception</code></a></li>
214 <li><a href="#--secure-heapn"><code>--secure-heap=n</code></a></li>
215 <li><a href="#--secure-heap-minn"><code>--secure-heap-min=n</code></a></li>
216 <li><span class="stability_1"><a href="#--snapshot-blobpath"><code>--snapshot-blob=path</code></a><…
217 <li><a href="#--test"><code>--test</code></a></li>
218 <li><a href="#--test-concurrency"><code>--test-concurrency</code></a></li>
219 <li><a href="#--test-name-pattern"><code>--test-name-pattern</code></a></li>
220 <li><a href="#--test-reporter"><code>--test-reporter</code></a></li>
221 <li><a href="#--test-reporter-destination"><code>--test-reporter-destination</code></a></li>
222 <li><a href="#--test-only"><code>--test-only</code></a></li>
223 <li><a href="#--test-shard"><code>--test-shard</code></a></li>
224 <li><a href="#--throw-deprecation"><code>--throw-deprecation</code></a></li>
225 <li><a href="#--titletitle"><code>--title=title</code></a></li>
226 <li><a href="#--tls-cipher-listlist"><code>--tls-cipher-list=list</code></a></li>
227 <li><a href="#--tls-keylogfile"><code>--tls-keylog=file</code></a></li>
228 <li><a href="#--tls-max-v12"><code>--tls-max-v1.2</code></a></li>
229 <li><a href="#--tls-max-v13"><code>--tls-max-v1.3</code></a></li>
230 <li><a href="#--tls-min-v10"><code>--tls-min-v1.0</code></a></li>
231 <li><a href="#--tls-min-v11"><code>--tls-min-v1.1</code></a></li>
232 <li><a href="#--tls-min-v12"><code>--tls-min-v1.2</code></a></li>
233 <li><a href="#--tls-min-v13"><code>--tls-min-v1.3</code></a></li>
234 <li><span class="stability_0"><a href="#--trace-atomics-wait"><code>--trace-atomics-wait</code></a>…
235 <li><a href="#--trace-deprecation"><code>--trace-deprecation</code></a></li>
236 <li><a href="#--trace-event-categories"><code>--trace-event-categories</code></a></li>
237 <li><a href="#--trace-event-file-pattern"><code>--trace-event-file-pattern</code></a></li>
238 <li><a href="#--trace-events-enabled"><code>--trace-events-enabled</code></a></li>
239 <li><a href="#--trace-exit"><code>--trace-exit</code></a></li>
240 <li><a href="#--trace-sigint"><code>--trace-sigint</code></a></li>
241 <li><a href="#--trace-sync-io"><code>--trace-sync-io</code></a></li>
242 <li><a href="#--trace-tls"><code>--trace-tls</code></a></li>
243 <li><a href="#--trace-uncaught"><code>--trace-uncaught</code></a></li>
244 <li><a href="#--trace-warnings"><code>--trace-warnings</code></a></li>
245 <li><a href="#--track-heap-objects"><code>--track-heap-objects</code></a></li>
246 <li><a href="#--unhandled-rejectionsmode"><code>--unhandled-rejections=mode</code></a></li>
247 <li><a href="#--use-bundled-ca---use-openssl-ca"><code>--use-bundled-ca</code>, <code>--use-openssl…
248 <li><a href="#--use-largepagesmode"><code>--use-largepages=mode</code></a></li>
249 <li><a href="#--v8-options"><code>--v8-options</code></a></li>
250 <li><a href="#--v8-pool-sizenum"><code>--v8-pool-size=num</code></a></li>
251 <li><span class="stability_1"><a href="#--watch"><code>--watch</code></a></span></li>
252 <li><span class="stability_1"><a href="#--watch-path"><code>--watch-path</code></a></span></li>
253 <li><a href="#--watch-preserve-output"><code>--watch-preserve-output</code></a></li>
254 <li><a href="#--zero-fill-buffers"><code>--zero-fill-buffers</code></a></li>
255 <li><a href="#-c---check"><code>-c</code>, <code>--check</code></a></li>
256 <li><a href="#-e---eval-script"><code>-e</code>, <code>--eval "script"</code></a></li>
257 <li><a href="#-h---help"><code>-h</code>, <code>--help</code></a></li>
258 <li><a href="#-i---interactive"><code>-i</code>, <code>--interactive</code></a></li>
259 <li><a href="#-p---print-script"><code>-p</code>, <code>--print "script"</code></a></li>
260 <li><a href="#-r---require-module"><code>-r</code>, <code>--require module</code></a></li>
261 <li><a href="#-v---version"><code>-v</code>, <code>--version</code></a></li>
264 <li><a href="#environment-variables">Environment variables</a>
266 <li><a href="#force_color1-2-3"><code>FORCE_COLOR=[1, 2, 3]</code></a></li>
267 <li><a href="#node_debugmodule"><code>NODE_DEBUG=module[,…]</code></a></li>
268 <li><a href="#node_debug_nativemodule"><code>NODE_DEBUG_NATIVE=module[,…]</code></a></li>
269 <li><a href="#node_disable_colors1"><code>NODE_DISABLE_COLORS=1</code></a></li>
270 <li><a href="#node_extra_ca_certsfile"><code>NODE_EXTRA_CA_CERTS=file</code></a></li>
271 <li><a href="#node_icu_datafile"><code>NODE_ICU_DATA=file</code></a></li>
272 <li><a href="#node_no_warnings1"><code>NODE_NO_WARNINGS=1</code></a></li>
273 <li><a href="#node_optionsoptions"><code>NODE_OPTIONS=options...</code></a></li>
274 <li><a href="#node_pathpath"><code>NODE_PATH=path[:…]</code></a></li>
275 <li><a href="#node_pending_deprecation1"><code>NODE_PENDING_DEPRECATION=1</code></a></li>
276 …li><a href="#node_pending_pipe_instancesinstances"><code>NODE_PENDING_PIPE_INSTANCES=instances</co…
277 <li><a href="#node_preserve_symlinks1"><code>NODE_PRESERVE_SYMLINKS=1</code></a></li>
278 <li><a href="#node_redirect_warningsfile"><code>NODE_REDIRECT_WARNINGS=file</code></a></li>
279 <li><a href="#node_repl_historyfile"><code>NODE_REPL_HISTORY=file</code></a></li>
280 <li><a href="#node_repl_external_modulefile"><code>NODE_REPL_EXTERNAL_MODULE=file</code></a></li>
281 <li><a href="#node_skip_platform_checkvalue"><code>NODE_SKIP_PLATFORM_CHECK=value</code></a></li>
282 <li><a href="#node_test_contextvalue"><code>NODE_TEST_CONTEXT=value</code></a></li>
283 <li><a href="#node_tls_reject_unauthorizedvalue"><code>NODE_TLS_REJECT_UNAUTHORIZED=value</code></a…
284 <li><a href="#node_v8_coveragedir"><code>NODE_V8_COVERAGE=dir</code></a>
286 <li><a href="#coverage-output">Coverage output</a></li>
287 <li><span class="stability_1"><a href="#source-map-cache">Source map cache</a></span></li>
290 <li><a href="#no_colorany"><code>NO_COLOR=<any></code></a></li>
291 <li><a href="#openssl_conffile"><code>OPENSSL_CONF=file</code></a></li>
292 <li><a href="#ssl_cert_dirdir"><code>SSL_CERT_DIR=dir</code></a></li>
293 <li><a href="#ssl_cert_filefile"><code>SSL_CERT_FILE=file</code></a></li>
294 <li><a href="#tz"><code>TZ</code></a></li>
295 <li><a href="#uv_threadpool_sizesize"><code>UV_THREADPOOL_SIZE=size</code></a></li>
298 <li><a href="#useful-v8-options">Useful V8 options</a>
300 <li><a href="#--max-old-space-sizesize-in-megabytes"><code>--max-old-space-size=SIZE</code> (in meg…
301 <li><a href="#--max-semi-space-sizesize-in-megabytes"><code>--max-semi-space-size=SIZE</code> (in m…
310 <li class="picker-header">
312 <span class="collapsed-arrow">►</span><span class="expanded-arrow">▼</span>
317 <li><a href="documentation.html" class="nav-documentation">About this documentation</a></li>
318 <li><a href="synopsis.html" class="nav-synopsis">Usage and example</a></li>
327 <li><a href="assert.html" class="nav-assert">Assertion testing</a></li>
328 <li><a href="async_context.html" class="nav-async_context">Asynchronous context tracking</a></li>
329 <li><a href="async_hooks.html" class="nav-async_hooks">Async hooks</a></li>
330 <li><a href="buffer.html" class="nav-buffer">Buffer</a></li>
331 <li><a href="addons.html" class="nav-addons">C++ addons</a></li>
332 <li><a href="n-api.html" class="nav-n-api">C/C++ addons with Node-API</a></li>
333 <li><a href="embedding.html" class="nav-embedding">C++ embedder API</a></li>
334 <li><a href="child_process.html" class="nav-child_process">Child processes</a></li>
335 <li><a href="cluster.html" class="nav-cluster">Cluster</a></li>
336 <li><a href="cli.html" class="nav-cli active">Command-line options</a></li>
337 <li><a href="console.html" class="nav-console">Console</a></li>
338 <li><a href="corepack.html" class="nav-corepack">Corepack</a></li>
339 <li><a href="crypto.html" class="nav-crypto">Crypto</a></li>
340 <li><a href="debugger.html" class="nav-debugger">Debugger</a></li>
341 <li><a href="deprecations.html" class="nav-deprecations">Deprecated APIs</a></li>
342 <li><a href="diagnostics_channel.html" class="nav-diagnostics_channel">Diagnostics Channel</a></li>
343 <li><a href="dns.html" class="nav-dns">DNS</a></li>
344 <li><a href="domain.html" class="nav-domain">Domain</a></li>
345 <li><a href="errors.html" class="nav-errors">Errors</a></li>
346 <li><a href="events.html" class="nav-events">Events</a></li>
347 <li><a href="fs.html" class="nav-fs">File system</a></li>
348 <li><a href="globals.html" class="nav-globals">Globals</a></li>
349 <li><a href="http.html" class="nav-http">HTTP</a></li>
350 <li><a href="http2.html" class="nav-http2">HTTP/2</a></li>
351 <li><a href="https.html" class="nav-https">HTTPS</a></li>
352 <li><a href="inspector.html" class="nav-inspector">Inspector</a></li>
353 <li><a href="intl.html" class="nav-intl">Internationalization</a></li>
354 <li><a href="modules.html" class="nav-modules">Modules: CommonJS modules</a></li>
355 <li><a href="esm.html" class="nav-esm">Modules: ECMAScript modules</a></li>
356 <li><a href="module.html" class="nav-module">Modules: <code>node:module</code> API</a></li>
357 <li><a href="packages.html" class="nav-packages">Modules: Packages</a></li>
358 <li><a href="net.html" class="nav-net">Net</a></li>
359 <li><a href="os.html" class="nav-os">OS</a></li>
360 <li><a href="path.html" class="nav-path">Path</a></li>
361 <li><a href="perf_hooks.html" class="nav-perf_hooks">Performance hooks</a></li>
362 <li><a href="permissions.html" class="nav-permissions">Permissions</a></li>
363 <li><a href="process.html" class="nav-process">Process</a></li>
364 <li><a href="punycode.html" class="nav-punycode">Punycode</a></li>
365 <li><a href="querystring.html" class="nav-querystring">Query strings</a></li>
366 <li><a href="readline.html" class="nav-readline">Readline</a></li>
367 <li><a href="repl.html" class="nav-repl">REPL</a></li>
368 <li><a href="report.html" class="nav-report">Report</a></li>
369 <li><a href="single-executable-applications.html" class="nav-single-executable-applications">Single…
370 <li><a href="stream.html" class="nav-stream">Stream</a></li>
371 <li><a href="string_decoder.html" class="nav-string_decoder">String decoder</a></li>
372 <li><a href="test.html" class="nav-test">Test runner</a></li>
373 <li><a href="timers.html" class="nav-timers">Timers</a></li>
374 <li><a href="tls.html" class="nav-tls">TLS/SSL</a></li>
375 <li><a href="tracing.html" class="nav-tracing">Trace events</a></li>
376 <li><a href="tty.html" class="nav-tty">TTY</a></li>
377 <li><a href="dgram.html" class="nav-dgram">UDP/datagram</a></li>
378 <li><a href="url.html" class="nav-url">URL</a></li>
379 <li><a href="util.html" class="nav-util">Utilities</a></li>
380 <li><a href="v8.html" class="nav-v8">V8</a></li>
381 <li><a href="vm.html" class="nav-vm">VM</a></li>
382 <li><a href="wasi.html" class="nav-wasi">WASI</a></li>
383 <li><a href="webcrypto.html" class="nav-webcrypto">Web Crypto API</a></li>
384 <li><a href="webstreams.html" class="nav-webstreams">Web Streams API</a></li>
385 <li><a href="worker_threads.html" class="nav-worker_threads">Worker threads</a></li>
386 <li><a href="zlib.html" class="nav-zlib">Zlib</a></li>
390 <li><a href="https://github.com/nodejs/node" class="nav-https-github-com-nodejs-node">Code reposito…
395 <li class="picker-header">
397 <span class="collapsed-arrow">►</span><span class="expanded-arrow">▼</span>
400 …<div class="picker"><ol id="alt-docs"><li><a href="https://nodejs.org/docs/latest-v21.x/api/cli.ht…
401 <li><a href="https://nodejs.org/docs/latest-v20.x/api/cli.html">20.x <b>LTS</b></a></li>
402 <li><a href="https://nodejs.org/docs/latest-v19.x/api/cli.html">19.x</a></li>
403 <li><a href="https://nodejs.org/docs/latest-v18.x/api/cli.html">18.x <b>LTS</b></a></li>
404 <li><a href="https://nodejs.org/docs/latest-v17.x/api/cli.html">17.x</a></li>
405 <li><a href="https://nodejs.org/docs/latest-v16.x/api/cli.html">16.x</a></li>
406 <li><a href="https://nodejs.org/docs/latest-v15.x/api/cli.html">15.x</a></li>
407 <li><a href="https://nodejs.org/docs/latest-v14.x/api/cli.html">14.x</a></li>
408 <li><a href="https://nodejs.org/docs/latest-v13.x/api/cli.html">13.x</a></li>
409 <li><a href="https://nodejs.org/docs/latest-v12.x/api/cli.html">12.x</a></li>
410 <li><a href="https://nodejs.org/docs/latest-v11.x/api/cli.html">11.x</a></li>
411 <li><a href="https://nodejs.org/docs/latest-v10.x/api/cli.html">10.x</a></li>
412 <li><a href="https://nodejs.org/docs/latest-v9.x/api/cli.html">9.x</a></li>
413 <li><a href="https://nodejs.org/docs/latest-v8.x/api/cli.html">8.x</a></li>
414 <li><a href="https://nodejs.org/docs/latest-v7.x/api/cli.html">7.x</a></li>
415 <li><a href="https://nodejs.org/docs/latest-v6.x/api/cli.html">6.x</a></li>
416 <li><a href="https://nodejs.org/docs/latest-v5.x/api/cli.html">5.x</a></li></ol></div>
419 <li class="picker-header">
421 … <span class="collapsed-arrow">►</span><span class="expanded-arrow">▼</span>
443 <li><a href="#command-line-api">Command-line API</a>
446 <li><a href="#program-entry-point">Program entry point</a>
448 <li><a href="#ecmascript-modules-loader-entry-point-caveat">ECMAScript modules loader entry point c…
453 <li><a href="#-"><code>-</code></a></li>
454 <li><a href="#--"><code>--</code></a></li>
455 <li><a href="#--abort-on-uncaught-exception"><code>--abort-on-uncaught-exception</code></a></li>
456 <li><span class="stability_1"><a href="#--build-snapshot"><code>--build-snapshot</code></a></span><…
457 <li><a href="#--completion-bash"><code>--completion-bash</code></a></li>
458 …ass="stability_1"><a href="#-c-condition---conditionscondition"><code>-C condition</code>, <code>-…
459 <li><span class="stability_1"><a href="#--cpu-prof"><code>--cpu-prof</code></a></span></li>
460 <li><span class="stability_1"><a href="#--cpu-prof-dir"><code>--cpu-prof-dir</code></a></span></li>
461 <li><span class="stability_1"><a href="#--cpu-prof-interval"><code>--cpu-prof-interval</code></a></…
462 <li><span class="stability_1"><a href="#--cpu-prof-name"><code>--cpu-prof-name</code></a></span></l…
463 <li><a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir=directory</code></a></li>
464 <li><a href="#--disable-protomode"><code>--disable-proto=mode</code></a></li>
465 <li><a href="#--disallow-code-generation-from-strings"><code>--disallow-code-generation-from-string…
466 <li><a href="#--dns-result-orderorder"><code>--dns-result-order=order</code></a></li>
467 <li><a href="#--enable-fips"><code>--enable-fips</code></a></li>
468 <li><a href="#--enable-network-family-autoselection"><code>--enable-network-family-autoselection</c…
469 <li><a href="#--enable-source-maps"><code>--enable-source-maps</code></a></li>
470 <li><a href="#--experimental-global-customevent"><code>--experimental-global-customevent</code></a>…
471 <li><a href="#--experimental-global-webcrypto"><code>--experimental-global-webcrypto</code></a></li>
472 …i><span class="stability_1"><a href="#--experimental-default-typetype"><code>--experimental-defaul…
473 <li><a href="#--experimental-import-meta-resolve"><code>--experimental-import-meta-resolve</code></…
474 <li><a href="#--experimental-loadermodule"><code>--experimental-loader=module</code></a></li>
475 …li><span class="stability_1"><a href="#--experimental-network-imports"><code>--experimental-networ…
476 <li><a href="#--experimental-policy"><code>--experimental-policy</code></a></li>
477 <li><a href="#--no-experimental-fetch"><code>--no-experimental-fetch</code></a></li>
478 <li><a href="#--no-experimental-repl-await"><code>--no-experimental-repl-await</code></a></li>
479 <li><a href="#--experimental-shadow-realm"><code>--experimental-shadow-realm</code></a></li>
480 <li><a href="#--experimental-specifier-resolutionmode"><code>--experimental-specifier-resolution=mo…
481 <li><a href="#--experimental-test-coverage"><code>--experimental-test-coverage</code></a></li>
482 <li><a href="#--experimental-vm-modules"><code>--experimental-vm-modules</code></a></li>
483 <li><a href="#--experimental-wasi-unstable-preview1"><code>--experimental-wasi-unstable-preview1</c…
484 <li><a href="#--experimental-wasm-modules"><code>--experimental-wasm-modules</code></a></li>
485 <li><a href="#--force-context-aware"><code>--force-context-aware</code></a></li>
486 <li><a href="#--force-fips"><code>--force-fips</code></a></li>
487 <li><span class="stability_1"><a href="#--frozen-intrinsics"><code>--frozen-intrinsics</code></a></…
488 <li><a href="#--force-node-api-uncaught-exceptions-policy"><code>--force-node-api-uncaught-exceptio…
489 …class="stability_1"><a href="#--heapsnapshot-near-heap-limitmax_count"><code>--heapsnapshot-near-h…
490 <li><a href="#--heapsnapshot-signalsignal"><code>--heapsnapshot-signal=signal</code></a></li>
491 <li><span class="stability_1"><a href="#--heap-prof"><code>--heap-prof</code></a></span></li>
492 <li><span class="stability_1"><a href="#--heap-prof-dir"><code>--heap-prof-dir</code></a></span></l…
493 <li><span class="stability_1"><a href="#--heap-prof-interval"><code>--heap-prof-interval</code></a>…
494 <li><span class="stability_1"><a href="#--heap-prof-name"><code>--heap-prof-name</code></a></span><…
495 <li><a href="#--icu-data-dirfile"><code>--icu-data-dir=file</code></a></li>
496 <li><span class="stability_1"><a href="#--importmodule"><code>--import=module</code></a></span></li>
497 <li><a href="#--input-typetype"><code>--input-type=type</code></a></li>
498 <li><a href="#--inspect-brkhostport"><code>--inspect-brk[=[host:]port]</code></a></li>
499 <li><a href="#--inspect-porthostport"><code>--inspect-port=[host:]port</code></a></li>
500 <li><a href="#--inspecthostport"><code>--inspect[=[host:]port]</code></a>
502 <li><a href="#warning-binding-inspector-to-a-public-ipport-combination-is-insecure">Warning: bindin…
505 <li><a href="#--inspect-publish-uidstderrhttp"><code>--inspect-publish-uid=stderr,http</code></a></…
506 <li><a href="#--insecure-http-parser"><code>--insecure-http-parser</code></a></li>
507 <li><a href="#--jitless"><code>--jitless</code></a></li>
508 <li><a href="#--max-http-header-sizesize"><code>--max-http-header-size=size</code></a></li>
509 <li><a href="#--napi-modules"><code>--napi-modules</code></a></li>
510 <li><a href="#--no-addons"><code>--no-addons</code></a></li>
511 <li><a href="#--no-deprecation"><code>--no-deprecation</code></a></li>
512 <li><a href="#--no-extra-info-on-fatal-exception"><code>--no-extra-info-on-fatal-exception</code></…
513 <li><a href="#--no-force-async-hooks-checks"><code>--no-force-async-hooks-checks</code></a></li>
514 <li><a href="#--no-global-search-paths"><code>--no-global-search-paths</code></a></li>
515 <li><a href="#--no-warnings"><code>--no-warnings</code></a></li>
516 <li><a href="#--node-memory-debug"><code>--node-memory-debug</code></a></li>
517 <li><a href="#--openssl-configfile"><code>--openssl-config=file</code></a></li>
518 <li><a href="#--openssl-shared-config"><code>--openssl-shared-config</code></a></li>
519 <li><a href="#--openssl-legacy-provider"><code>--openssl-legacy-provider</code></a></li>
520 <li><a href="#--pending-deprecation"><code>--pending-deprecation</code></a></li>
521 <li><span class="stability_1"><a href="#--policy-integritysri"><code>--policy-integrity=sri</code><…
522 <li><a href="#--preserve-symlinks"><code>--preserve-symlinks</code></a></li>
523 <li><a href="#--preserve-symlinks-main"><code>--preserve-symlinks-main</code></a></li>
524 <li><a href="#--prof"><code>--prof</code></a></li>
525 <li><a href="#--prof-process"><code>--prof-process</code></a></li>
526 <li><a href="#--redirect-warningsfile"><code>--redirect-warnings=file</code></a></li>
527 <li><a href="#--report-compact"><code>--report-compact</code></a></li>
528 <li><a href="#--report-dirdirectory-report-directorydirectory"><code>--report-dir=directory</code>,…
529 <li><a href="#--report-filenamefilename"><code>--report-filename=filename</code></a></li>
530 <li><a href="#--report-on-fatalerror"><code>--report-on-fatalerror</code></a></li>
531 <li><a href="#--report-on-signal"><code>--report-on-signal</code></a></li>
532 <li><a href="#--report-signalsignal"><code>--report-signal=signal</code></a></li>
533 <li><a href="#--report-uncaught-exception"><code>--report-uncaught-exception</code></a></li>
534 <li><a href="#--secure-heapn"><code>--secure-heap=n</code></a></li>
535 <li><a href="#--secure-heap-minn"><code>--secure-heap-min=n</code></a></li>
536 <li><span class="stability_1"><a href="#--snapshot-blobpath"><code>--snapshot-blob=path</code></a><…
537 <li><a href="#--test"><code>--test</code></a></li>
538 <li><a href="#--test-concurrency"><code>--test-concurrency</code></a></li>
539 <li><a href="#--test-name-pattern"><code>--test-name-pattern</code></a></li>
540 <li><a href="#--test-reporter"><code>--test-reporter</code></a></li>
541 <li><a href="#--test-reporter-destination"><code>--test-reporter-destination</code></a></li>
542 <li><a href="#--test-only"><code>--test-only</code></a></li>
543 <li><a href="#--test-shard"><code>--test-shard</code></a></li>
544 <li><a href="#--throw-deprecation"><code>--throw-deprecation</code></a></li>
545 <li><a href="#--titletitle"><code>--title=title</code></a></li>
546 <li><a href="#--tls-cipher-listlist"><code>--tls-cipher-list=list</code></a></li>
547 <li><a href="#--tls-keylogfile"><code>--tls-keylog=file</code></a></li>
548 <li><a href="#--tls-max-v12"><code>--tls-max-v1.2</code></a></li>
549 <li><a href="#--tls-max-v13"><code>--tls-max-v1.3</code></a></li>
550 <li><a href="#--tls-min-v10"><code>--tls-min-v1.0</code></a></li>
551 <li><a href="#--tls-min-v11"><code>--tls-min-v1.1</code></a></li>
552 <li><a href="#--tls-min-v12"><code>--tls-min-v1.2</code></a></li>
553 <li><a href="#--tls-min-v13"><code>--tls-min-v1.3</code></a></li>
554 <li><span class="stability_0"><a href="#--trace-atomics-wait"><code>--trace-atomics-wait</code></a>…
555 <li><a href="#--trace-deprecation"><code>--trace-deprecation</code></a></li>
556 <li><a href="#--trace-event-categories"><code>--trace-event-categories</code></a></li>
557 <li><a href="#--trace-event-file-pattern"><code>--trace-event-file-pattern</code></a></li>
558 <li><a href="#--trace-events-enabled"><code>--trace-events-enabled</code></a></li>
559 <li><a href="#--trace-exit"><code>--trace-exit</code></a></li>
560 <li><a href="#--trace-sigint"><code>--trace-sigint</code></a></li>
561 <li><a href="#--trace-sync-io"><code>--trace-sync-io</code></a></li>
562 <li><a href="#--trace-tls"><code>--trace-tls</code></a></li>
563 <li><a href="#--trace-uncaught"><code>--trace-uncaught</code></a></li>
564 <li><a href="#--trace-warnings"><code>--trace-warnings</code></a></li>
565 <li><a href="#--track-heap-objects"><code>--track-heap-objects</code></a></li>
566 <li><a href="#--unhandled-rejectionsmode"><code>--unhandled-rejections=mode</code></a></li>
567 <li><a href="#--use-bundled-ca---use-openssl-ca"><code>--use-bundled-ca</code>, <code>--use-openssl…
568 <li><a href="#--use-largepagesmode"><code>--use-largepages=mode</code></a></li>
569 <li><a href="#--v8-options"><code>--v8-options</code></a></li>
570 <li><a href="#--v8-pool-sizenum"><code>--v8-pool-size=num</code></a></li>
571 <li><span class="stability_1"><a href="#--watch"><code>--watch</code></a></span></li>
572 <li><span class="stability_1"><a href="#--watch-path"><code>--watch-path</code></a></span></li>
573 <li><a href="#--watch-preserve-output"><code>--watch-preserve-output</code></a></li>
574 <li><a href="#--zero-fill-buffers"><code>--zero-fill-buffers</code></a></li>
575 <li><a href="#-c---check"><code>-c</code>, <code>--check</code></a></li>
576 <li><a href="#-e---eval-script"><code>-e</code>, <code>--eval "script"</code></a></li>
577 <li><a href="#-h---help"><code>-h</code>, <code>--help</code></a></li>
578 <li><a href="#-i---interactive"><code>-i</code>, <code>--interactive</code></a></li>
579 <li><a href="#-p---print-script"><code>-p</code>, <code>--print "script"</code></a></li>
580 <li><a href="#-r---require-module"><code>-r</code>, <code>--require module</code></a></li>
581 <li><a href="#-v---version"><code>-v</code>, <code>--version</code></a></li>
584 <li><a href="#environment-variables">Environment variables</a>
586 <li><a href="#force_color1-2-3"><code>FORCE_COLOR=[1, 2, 3]</code></a></li>
587 <li><a href="#node_debugmodule"><code>NODE_DEBUG=module[,…]</code></a></li>
588 <li><a href="#node_debug_nativemodule"><code>NODE_DEBUG_NATIVE=module[,…]</code></a></li>
589 <li><a href="#node_disable_colors1"><code>NODE_DISABLE_COLORS=1</code></a></li>
590 <li><a href="#node_extra_ca_certsfile"><code>NODE_EXTRA_CA_CERTS=file</code></a></li>
591 <li><a href="#node_icu_datafile"><code>NODE_ICU_DATA=file</code></a></li>
592 <li><a href="#node_no_warnings1"><code>NODE_NO_WARNINGS=1</code></a></li>
593 <li><a href="#node_optionsoptions"><code>NODE_OPTIONS=options...</code></a></li>
594 <li><a href="#node_pathpath"><code>NODE_PATH=path[:…]</code></a></li>
595 <li><a href="#node_pending_deprecation1"><code>NODE_PENDING_DEPRECATION=1</code></a></li>
596 …li><a href="#node_pending_pipe_instancesinstances"><code>NODE_PENDING_PIPE_INSTANCES=instances</co…
597 <li><a href="#node_preserve_symlinks1"><code>NODE_PRESERVE_SYMLINKS=1</code></a></li>
598 <li><a href="#node_redirect_warningsfile"><code>NODE_REDIRECT_WARNINGS=file</code></a></li>
599 <li><a href="#node_repl_historyfile"><code>NODE_REPL_HISTORY=file</code></a></li>
600 <li><a href="#node_repl_external_modulefile"><code>NODE_REPL_EXTERNAL_MODULE=file</code></a></li>
601 <li><a href="#node_skip_platform_checkvalue"><code>NODE_SKIP_PLATFORM_CHECK=value</code></a></li>
602 <li><a href="#node_test_contextvalue"><code>NODE_TEST_CONTEXT=value</code></a></li>
603 <li><a href="#node_tls_reject_unauthorizedvalue"><code>NODE_TLS_REJECT_UNAUTHORIZED=value</code></a…
604 <li><a href="#node_v8_coveragedir"><code>NODE_V8_COVERAGE=dir</code></a>
606 <li><a href="#coverage-output">Coverage output</a></li>
607 <li><span class="stability_1"><a href="#source-map-cache">Source map cache</a></span></li>
610 <li><a href="#no_colorany"><code>NO_COLOR=<any></code></a></li>
611 <li><a href="#openssl_conffile"><code>OPENSSL_CONF=file</code></a></li>
612 <li><a href="#ssl_cert_dirdir"><code>SSL_CERT_DIR=dir</code></a></li>
613 <li><a href="#ssl_cert_filefile"><code>SSL_CERT_FILE=file</code></a></li>
614 <li><a href="#tz"><code>TZ</code></a></li>
615 <li><a href="#uv_threadpool_sizesize"><code>UV_THREADPOOL_SIZE=size</code></a></li>
618 <li><a href="#useful-v8-options">Useful V8 options</a>
620 <li><a href="#--max-old-space-sizesize-in-megabytes"><code>--max-old-space-size=SIZE</code> (in meg…
621 <li><a href="#--max-semi-space-sizesize-in-megabytes"><code>--max-semi-space-size=SIZE</code> (in m…
629 …<h2>Command-line API<span><a class="mark" href="#command-line-api" id="command-line-api">#</a></sp…
632 <p>Node.js comes with a variety of CLI options. These options expose built-in
634 <p>To view this documentation as a manual page in a terminal, run <code>man node</code>.</p>
635 <section><h3>Synopsis<span><a class="mark" href="#synopsis" id="synopsis">#</a></span><a aria-hidde…
636 <p><code>node [options] [V8 options] [<program-entry-point> | -e "script" | -] [--] [arguments…
637 <p><code>node inspect [<program-entry-point> | -e "script" | <host>:<port>] …</code>…
638 <p><code>node --v8-options</code></p>
640 <p>For more info about <code>node inspect</code>, see the <a href="debugger.html">debugger</a> docu…
641 …entry point<span><a class="mark" href="#program-entry-point" id="program-entry-point">#</a></span>…
642 <p>The program entry point is a specifier-like string. If the string is not an
645 …es.html#modules-loaders">ES module loader</a> if <a href="#--experimental-default-typetype"><code>…
648 <a href="packages.html#modules-loaders">ES module loader</a> under any of the following conditions:…
650 <li>The program was started with a command-line flag that forces the entry
651 point to be loaded with ECMAScript module loader, such as <code>--import</code> or
652 <a href="#--experimental-default-typetype"><code>--experimental-default-type=module</code></a>.</li>
653 <li>The file has an <code>.mjs</code> extension.</li>
654 <li>The file does not have a <code>.cjs</code> extension, and the nearest parent
655 <code>package.json</code> file contains a top-level <a href="packages.html#type"><code>"type"</code…
656 <code>"module"</code>.</li>
659 <a href="packages.html#modules-loaders">Modules loaders</a> for more details.</p>
660 …mark" href="#ecmascript-modules-loader-entry-point-caveat" id="ecmascript-modules-loader-entry-poi…
661 <p>When loading, the <a href="packages.html#modules-loaders">ES module loader</a> loads the program
662 entry point, the <code>node</code> command will accept as input only files with <code>.js</code>,
663 <code>.mjs</code>, or <code>.cjs</code> extensions; with <code>.wasm</code> extensions when
664 <a href="#--experimental-wasm-modules"><code>--experimental-wasm-modules</code></a> is enabled; and…
665 <a href="#--experimental-default-typetype"><code>--experimental-default-type=module</code></a> is p…
666 …ptions<span><a class="mark" href="#options" id="options">#</a></span><a aria-hidden="true" class="…
677 dashes (<code>-</code>) or underscores (<code>_</code>). For example, <code>--pending-deprecation</…
678 equivalent to <code>--pending_deprecation</code>.</p>
679 <p>If an option that takes a single value (such as <code>--max-http-header-size</code>) is
681 …edence over options passed through the <a href="#node_optionsoptions"><code>NODE_OPTIONS</code></a>
683 <h4><code>-</code><span><a class="mark" href="#-" id="-">#</a></span><a aria-hidden="true" class="l…
687 <p>Alias for stdin. Analogous to the use of <code>-</code> in other command-line utilities,
690 <h4><code>--</code><span><a class="mark" href="#--" id="--">#</a></span><a aria-hidden="true" class…
697 …code>--abort-on-uncaught-exception</code><span><a class="mark" href="#--abort-on-uncaught-exceptio…
701 <p>Aborting instead of exiting causes a core file to be generated for post-mortem
702 analysis using a debugger (such as <code>lldb</code>, <code>gdb</code>, and <code>mdb</code>).</p>
704 …#processsetuncaughtexceptioncapturecallbackfn"><code>process.setUncaughtExceptionCaptureCallback()…
705 <code>node:domain</code> module that uses it).</p>
706 <h4><code>--build-snapshot</code><span><a class="mark" href="#--build-snapshot" id="--build-snapsho…
710 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
712 disk, which can be loaded later with <code>--snapshot-blob</code>.</p>
713 <p>When building the snapshot, if <code>--snapshot-blob</code> is not specified,
714 the generated blob will be written, by default, to <code>snapshot.blob</code>
716 the path specified by <code>--snapshot-blob</code>.</p>
717 …code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"…
718 <span class="hljs-meta prompt_">
719 # </span><span class="language-bash">Run snapshot.js to initialize the application and snapshot the…
720 <span class="hljs-meta prompt_"># </span><span class="language-bash">state of it into snapshot.blob…
721 <span class="hljs-meta prompt_">$ </span><span class="language-bash">node --snapshot-blob snapshot.…
722 <span class="hljs-meta prompt_">
723 $ </span><span class="language-bash"><span class="hljs-built_in">echo</span> <span class="hljs-stri…
724 <span class="hljs-meta prompt_">
725 # </span><span class="language-bash">Load the generated snapshot and start the application from ind…
726 <span class="hljs-meta prompt_">$ </span><span class="language-bash">node --snapshot-blob snapshot.…
727 I am from the snapshot</code> <button class="copy-button">copy</button></pre>
728 <p>The <a href="v8.html#startup-snapshot-api"><code>v8.startupSnapshot</code> API</a> can be used t…
731 …code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"…
732 <span class="hljs-meta prompt_">$ </span><span class="language-bash">node --snapshot-blob snapshot.…
733 <span class="hljs-meta prompt_">$ </span><span class="language-bash">node --snapshot-blob snapshot.…
734 I am from the snapshot</code> <button class="copy-button">copy</button></pre>
735 …re information, check out the <a href="v8.html#startup-snapshot-api"><code>v8.startupSnapshot</cod…
736 <p>Currently the support for run-time snapshot is experimental in that:</p>
738 <li>User-land modules are not yet supported in the snapshot, so only
742 <li>Only a subset of the built-in modules work in the snapshot, though the
747 <a href="https://github.com/nodejs/node/issues/44014">tracking issue for user-land snapshots</a>.</…
749 <h4><code>--completion-bash</code><span><a class="mark" href="#--completion-bash" id="--completion-…
753 <p>Print source-able bash completion script for Node.js.</p>
754 <pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-…
755 …js-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">source</span> no…
756 …code>-C condition</code>, <code>--conditions=condition</code><span><a class="mark" href="#-c-condi…
760 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
761 <p>Enable experimental support for custom <a href="packages.html#conditional-exports">conditional e…
764 <p>The default Node.js conditions of <code>"node"</code>, <code>"default"</code>, <code>"import"</c…
765 <code>"require"</code> will always apply as defined.</p>
767 …code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"…
768 <h4><code>--cpu-prof</code><span><a class="mark" href="#--cpu-prof" id="--cpu-prof">#</a></span><a …
772 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
775 <p>If <code>--cpu-prof-dir</code> is not specified, the generated profile is placed
777 <p>If <code>--cpu-prof-name</code> is not specified, the generated profile is
778 named <code>CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile</code>.</p>
779 <pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-…
780 <span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">ls…
781 CPU.20190409.202950.15293.0.0.cpuprofile</code> <button class="copy-button">copy</button></pre>
782 <h4><code>--cpu-prof-dir</code><span><a class="mark" href="#--cpu-prof-dir" id="--cpu-prof-dir">#</…
786 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
787 <p>Specify the directory where the CPU profiles generated by <code>--cpu-prof</code> will
790 <a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir</code></a> command-line option.</p>
791 <h4><code>--cpu-prof-interval</code><span><a class="mark" href="#--cpu-prof-interval" id="--cpu-pro…
795 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
797 by <code>--cpu-prof</code>. The default is 1000 microseconds.</p>
798 <h4><code>--cpu-prof-name</code><span><a class="mark" href="#--cpu-prof-name" id="--cpu-prof-name">…
802 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
803 <p>Specify the file name of the CPU profile generated by <code>--cpu-prof</code>.</p>
804 …h4><code>--diagnostic-dir=directory</code><span><a class="mark" href="#--diagnostic-dirdirectory" …
809 <li><a href="#--cpu-prof-dir"><code>--cpu-prof-dir</code></a></li>
810 <li><a href="#--heap-prof-dir"><code>--heap-prof-dir</code></a></li>
811 <li><a href="#--redirect-warningsfile"><code>--redirect-warnings</code></a></li>
813 <h4><code>--disable-proto=mode</code><span><a class="mark" href="#--disable-protomode" id="--disabl…
817 <p>Disable the <code>Object.prototype.__proto__</code> property. If <code>mode</code> is <code>dele…
818 property is removed entirely. If <code>mode</code> is <code>throw</code>, accesses to the
819 property throw an exception with the code <code>ERR_PROTO_ACCESS</code>.</p>
820 …code>--disallow-code-generation-from-strings</code><span><a class="mark" href="#--disallow-code-ge…
824 <p>Make built-in language features like <code>eval</code> and <code>new Function</code> that genera…
825 code from strings throw an exception instead. This does not affect the Node.js
826 <code>node:vm</code> module.</p>
827 <h4><code>--dns-result-order=order</code><span><a class="mark" href="#--dns-result-orderorder" id="…
833 <td><p>Changed default value to <code>verbatim</code>.</p></td></tr>
839 …et the default value of <code>verbatim</code> in <a href="dns.html#dnslookuphostname-options-callb…
840 <a href="dns.html#dnspromiseslookuphostname-options"><code>dnsPromises.lookup()</code></a>. The val…
842 <li><code>ipv4first</code>: sets default <code>verbatim</code> <code>false</code>.</li>
843 <li><code>verbatim</code>: sets default <code>verbatim</code> <code>true</code>.</li>
845 <p>The default is <code>verbatim</code> and <a href="dns.html#dnssetdefaultresultorderorder"><code>…
846 priority than <code>--dns-result-order</code>.</p>
847 <h4><code>--enable-fips</code><span><a class="mark" href="#--enable-fips" id="--enable-fips">#</a><…
851 <p>Enable FIPS-compliant crypto at startup. (Requires Node.js to be built
852 against FIPS-compatible OpenSSL.)</p>
853 …code>--enable-network-family-autoselection</code><span><a class="mark" href="#--enable-network-fam…
859 <h4><code>--enable-source-maps</code><span><a class="mark" href="#--enable-source-maps" id="--enabl…
873 application reference the transpiled code, not the original source position.
874 <code>--enable-source-maps</code> enables caching of Source Maps and makes a best
876 <p>Overriding <code>Error.prepareStackTrace</code> prevents <code>--enable-source-maps</code> from
879 when <code>Error.stack</code> is accessed. If you access <code>Error.stack</code> frequently
881 of <code>--enable-source-maps</code>.</p>
882 …code>--experimental-global-customevent</code><span><a class="mark" href="#--experimental-global-cu…
887 …code>--experimental-global-webcrypto</code><span><a class="mark" href="#--experimental-global-webc…
892 …code>--experimental-default-type=type</code><span><a class="mark" href="#--experimental-default-ty…
896 …ability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a>.0 - Early d…
897 <p>Define which module system, <code>module</code> or <code>commonjs</code>, to use for the followi…
900 <p>String input provided via <code>--eval</code> or STDIN, if <code>--input-type</code> is unspecif…
903 <p>Files ending in <code>.js</code> or with no extension, if there is no <code>package.json</code> …
907 <p>Files ending in <code>.js</code> or with no extension, if the nearest parent
908 <code>package.json</code> field lacks a <code>"type"</code> field; unless the <code>package.json</c…
909 or any parent folder is inside a <code>node_modules</code> folder.</p>
912 <p>In other words, <code>--experimental-default-type=module</code> flips all the places where
914 with the exception of folders and subfolders below <code>node_modules</code>, for backward
916 <p>Under <code>--experimental-default-type=module</code> and <code>--experimental-wasm-modules</cod…
918 WebAssembly magic number (<code>\0asm</code>); otherwise they will be treated as ES module
920 …code>--experimental-import-meta-resolve</code><span><a class="mark" href="#--experimental-import-m…
932 <p>Enable experimental <code>import.meta.resolve()</code> parent URL support, which allows
933 passing a second <code>parentURL</code> argument for contextual resolution.</p>
934 <p>Previously gated the entire <code>import.meta.resolve</code> feature.</p>
935 …<code>--experimental-loader=module</code><span><a class="mark" href="#--experimental-loadermodule"…
941 <td><p>This flag was renamed from <code>--loader</code> to <code>--experimental-loader</code>.</p><…
950 <a href="module.html#enabling"><code>--import</code> with <code>register()</code></a> instead.</p>
952 <p>Specify the <code>module</code> containing exported <a href="module.html#customization-hooks">mo…
953 <code>module</code> may be any string accepted as an <a href="esm.html#import-specifiers"><code>imp…
954 …code>--experimental-network-imports</code><span><a class="mark" href="#--experimental-network-impo…
958 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
959 <p>Enable experimental support for the <code>https:</code> protocol in <code>import</code> specifie…
960 <h4><code>--experimental-policy</code><span><a class="mark" href="#--experimental-policy" id="--exp…
965 <h4><code>--no-experimental-fetch</code><span><a class="mark" href="#--no-experimental-fetch" id="-…
969 <p>Disable experimental support for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/F…
970 …code>--no-experimental-repl-await</code><span><a class="mark" href="#--no-experimental-repl-await"…
974 <p>Use this flag to disable top-level await in REPL.</p>
975 …<code>--experimental-shadow-realm</code><span><a class="mark" href="#--experimental-shadow-realm" …
979 <p>Use this flag to enable <a href="https://github.com/tc39/proposal-shadowrealm">ShadowRealm</a> s…
980 …code>--experimental-specifier-resolution=mode</code><span><a class="mark" href="#--experimental-sp…
985 are <code>explicit</code> and <code>node</code>.</p>
986 <p>The default is <code>explicit</code>, which requires providing the full path to a
987 module. The <code>node</code> mode enables support for optional file extensions and
989 <p>See <a href="esm.html#customizing-esm-specifier-resolution-algorithm">customizing ESM specifier …
990 …code>--experimental-test-coverage</code><span><a class="mark" href="#--experimental-test-coverage"…
996 <td><p>This option can be used with <code>--test</code>.</p></td></tr>
1002 <p>When used in conjunction with the <code>node:test</code> module, a code coverage report is
1005 <a href="test.html#collecting-code-coverage">collecting code coverage from tests</a> for more detai…
1006 …h4><code>--experimental-vm-modules</code><span><a class="mark" href="#--experimental-vm-modules" i…
1010 <p>Enable experimental ES Module support in the <code>node:vm</code> module.</p>
1011 …code>--experimental-wasi-unstable-preview1</code><span><a class="mark" href="#--experimental-wasi-…
1019 <td><p>changed from <code>--experimental-wasi-unstable-preview0</code> to <code>--experimental-wasi…
1026 …<code>--experimental-wasm-modules</code><span><a class="mark" href="#--experimental-wasm-modules" …
1031 <h4><code>--force-context-aware</code><span><a class="mark" href="#--force-context-aware" id="--for…
1035 <p>Disable loading native addons that are not <a href="addons.html#context-aware-addons">context-aw…
1036 <h4><code>--force-fips</code><span><a class="mark" href="#--force-fips" id="--force-fips">#</a></sp…
1040 <p>Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.)
1041 (Same requirements as <code>--enable-fips</code>.)</p>
1042 <h4><code>--frozen-intrinsics</code><span><a class="mark" href="#--frozen-intrinsics" id="--frozen-…
1046 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1047 <p>Enable experimental frozen intrinsics like <code>Array</code> and <code>Object</code>.</p>
1049 <code>globalThis.Array</code> is indeed the default intrinsic reference. Code may break
1052 <a href="#-r---require-module"><code>--require</code></a> and <a href="#--importmodule"><code>--imp…
1053 …code>--force-node-api-uncaught-exceptions-policy</code><span><a class="mark" href="#--force-node-a…
1057 <p>Enforces <code>uncaughtException</code> event on Node-API asynchronous callbacks.</p>
1058 <p>To prevent from an existing add-on from crashing the process, this flag is not
1061 …code>--heapsnapshot-near-heap-limit=max_count</code><span><a class="mark" href="#--heapsnapshot-ne…
1065 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1067 heap limit. <code>count</code> should be a non-negative integer (in which case
1068 Node.js will write no more than <code>max_count</code> snapshots to disk).</p>
1074 write exactly <code>max_count</code> snapshots to disk, but it will try
1075 its best to generate at least one and up to <code>max_count</code> snapshots before the
1076 Node.js instance runs out of memory when <code>max_count</code> is greater than <code>0</code>.</p>
1084 …code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"…
1089 <--- Last few GCs --->
1091 [49580:0x110000000] 4826 ms: Mark-sweep 130.6 (147.8) -> 130.5 (147.8) MB, 27.4 / 0.0 ms (aver…
1092 [49580:0x110000000] 4845 ms: Mark-sweep 130.6 (147.8) -> 130.6 (147.8) MB, 18.8 / 0.0 ms (aver…
1095 <--- JS stacktrace --->
1097 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of m…
1098 ....</code> <button class="copy-button">copy</button></pre>
1099 …<code>--heapsnapshot-signal=signal</code><span><a class="mark" href="#--heapsnapshot-signalsignal"…
1104 when the specified signal is received. <code>signal</code> must be a valid signal name.
1106 <pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-…
1107 <span class="hljs-meta prompt_">$ </span><span class="language-bash">ps aux</span>
1109 node 1 5.5 6.1 787252 247004 ? Ssl 16:43 0:02 node --heapsnapshot-signal=SIGUSR2…
1110 <span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">ki…
1111 <span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">ls…
1112 Heap.20190718.133405.15554.0.001.heapsnapshot</code> <button class="copy-button">copy</button></pre>
1113 <h4><code>--heap-prof</code><span><a class="mark" href="#--heap-prof" id="--heap-prof">#</a></span>…
1117 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1120 <p>If <code>--heap-prof-dir</code> is not specified, the generated profile is placed
1122 <p>If <code>--heap-prof-name</code> is not specified, the generated profile is
1123 named <code>Heap.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.heapprofile</code>.</p>
1124 <pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-…
1125 <span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">ls…
1126 Heap.20190409.202950.15293.0.001.heapprofile</code> <button class="copy-button">copy</button></pre>
1127 <h4><code>--heap-prof-dir</code><span><a class="mark" href="#--heap-prof-dir" id="--heap-prof-dir">…
1131 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1132 <p>Specify the directory where the heap profiles generated by <code>--heap-prof</code> will
1135 <a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir</code></a> command-line option.</p>
1136 <h4><code>--heap-prof-interval</code><span><a class="mark" href="#--heap-prof-interval" id="--heap-…
1140 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1142 by <code>--heap-prof</code>. The default is 512 * 1024 bytes.</p>
1143 <h4><code>--heap-prof-name</code><span><a class="mark" href="#--heap-prof-name" id="--heap-prof-nam…
1147 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1148 <p>Specify the file name of the heap profile generated by <code>--heap-prof</code>.</p>
1149 <h4><code>--icu-data-dir=file</code><span><a class="mark" href="#--icu-data-dirfile" id="--icu-data…
1153 <p>Specify ICU data load path. (Overrides <code>NODE_ICU_DATA</code>.)</p>
1154 <h4><code>--import=module</code><span><a class="mark" href="#--importmodule" id="--importmodule">#<…
1158 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1160 <p>Follows <a href="esm.html#modules-ecmascript-modules">ECMAScript module</a> resolution rules.
1161 Use <a href="#-r---require-module"><code>--require</code></a> to load a <a href="modules.html">Comm…
1162 Modules preloaded with <code>--require</code> will run before modules preloaded with <code>--import…
1163 <h4><code>--input-type=type</code><span><a class="mark" href="#--input-typetype" id="--input-typety…
1168 module. String input is input via <code>--eval</code>, <code>--print</code>, or <code>STDIN</code>.…
1169 <p>Valid values are <code>"commonjs"</code> and <code>"module"</code>. The default is <code>"common…
1171 <h4><code>--inspect-brk[=[host:]port]</code><span><a class="mark" href="#--inspect-brkhostport" id=…
1175 <p>Activate inspector on <code>host:port</code> and break at start of user script.
1176 Default <code>host:port</code> is <code>127.0.0.1:9229</code>.</p>
1177 <h4><code>--inspect-port=[host:]port</code><span><a class="mark" href="#--inspect-porthostport" id=…
1181 <p>Set the <code>host:port</code> to be used when the inspector is activated.
1182 Useful when activating the inspector by sending the <code>SIGUSR1</code> signal.</p>
1183 <p>Default host is <code>127.0.0.1</code>.</p>
1184 …a href="#warning-binding-inspector-to-a-public-ipport-combination-is-insecure">security warning</a…
1186 <h4><code>--inspect[=[host:]port]</code><span><a class="mark" href="#--inspecthostport" id="--inspe…
1190 <p>Activate inspector on <code>host:port</code>. Default is <code>127.0.0.1:9229</code>.</p>
1193 tcp port and communicate using the <a href="https://chromedevtools.github.io/devtools-protocol/">Ch…
1194 <!-- Anchor to make sure old links find a target -->
1196 …-binding-inspector-to-a-public-ipport-combination-is-insecure" id="warning-binding-inspector-to-a-…
1197 <p>Binding the inspector to a public IP (including <code>0.0.0.0</code>) with an open port is
1199 a <a href="https://www.owasp.org/index.php/Code_Injection">remote code execution</a> attack.</p>
1205 <p><strong>More specifically, <code>--inspect=0.0.0.0</code> is insecure if the port (<code>9229</c…
1206 default) is not firewall-protected.</strong></p>
1207 <p>See the <a href="https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implicati…
1208 …code>--inspect-publish-uid=stderr,http</code><span><a class="mark" href="#--inspect-publish-uidstd…
1210 <p>By default inspector websocket url is available in stderr and under <code>/json/list</code>
1211 endpoint on <code>http://host:port/json/list</code>.</p>
1212 <h4><code>--insecure-http-parser</code><span><a class="mark" href="#--insecure-http-parser" id="--i…
1217 interoperability with non-conformant HTTP implementations. It may also allow
1220 <h4><code>--jitless</code><span><a class="mark" href="#--jitless" id="--jitless">#</a></span><a ari…
1228 disappear in a non-semver-major release.</p>
1229 …><code>--max-http-header-size=size</code><span><a class="mark" href="#--max-http-header-sizesize" …
1242 <h4><code>--napi-modules</code><span><a class="mark" href="#--napi-modules" id="--napi-modules">#</…
1246 <p>This option is a no-op. It is kept for compatibility.</p>
1247 <h4><code>--no-addons</code><span><a class="mark" href="#--no-addons" id="--no-addons">#</a></span>…
1251 <p>Disable the <code>node-addons</code> exports condition as well as disable loading
1252 native addons. When <code>--no-addons</code> is specified, calling <code>process.dlopen</code> or
1254 <h4><code>--no-deprecation</code><span><a class="mark" href="#--no-deprecation" id="--no-deprecatio…
1259 …code>--no-extra-info-on-fatal-exception</code><span><a class="mark" href="#--no-extra-info-on-fata…
1264 …code>--no-force-async-hooks-checks</code><span><a class="mark" href="#--no-force-async-hooks-check…
1268 <p>Disables runtime checks for <code>async_hooks</code>. These will still be enabled
1269 dynamically when <code>async_hooks</code> is enabled.</p>
1270 <h4><code>--no-global-search-paths</code><span><a class="mark" href="#--no-global-search-paths" id=…
1274 <p>Do not search modules from global paths like <code>$HOME/.node_modules</code> and
1275 <code>$NODE_PATH</code>.</p>
1276 <h4><code>--no-warnings</code><span><a class="mark" href="#--no-warnings" id="--no-warnings">#</a><…
1281 <h4><code>--node-memory-debug</code><span><a class="mark" href="#--node-memory-debug" id="--node-me…
1287 <h4><code>--openssl-config=file</code><span><a class="mark" href="#--openssl-configfile" id="--open…
1292 used to enable FIPS-compliant crypto if Node.js is built
1293 against FIPS-enabled OpenSSL.</p>
1294 <h4><code>--openssl-shared-config</code><span><a class="mark" href="#--openssl-shared-config" id="-…
1298 <p>Enable OpenSSL default configuration section, <code>openssl_conf</code> to be read from
1300 <code>openssl.cnf</code> but this can be changed using the environment variable
1301 <code>OPENSSL_CONF</code>, or by using the command line option <code>--openssl-config</code>.
1305 Node.js which is <code>nodejs_conf</code> and is default when this option is not used.</p>
1306 …h4><code>--openssl-legacy-provider</code><span><a class="mark" href="#--openssl-legacy-provider" i…
1311 <a href="https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html">OSSL_PROVIDER-legacy</…
1312 <h4><code>--pending-deprecation</code><span><a class="mark" href="#--pending-deprecation" id="--pen…
1319 unless either the <code>--pending-deprecation</code> command-line flag, or the
1320 <code>NODE_PENDING_DEPRECATION=1</code> environment variable, is set. Pending deprecations
1323 <h4><code>--policy-integrity=sri</code><span><a class="mark" href="#--policy-integritysri" id="--po…
1327 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1328 <p>Instructs Node.js to error prior to running any code if the policy does not have
1329 the specified integrity. It expects a <a href="https://developer.mozilla.org/en-US/docs/Web/Securit…
1331 <h4><code>--preserve-symlinks</code><span><a class="mark" href="#--preserve-symlinks" id="--preserv…
1338 to a different on-disk location, Node.js will dereference the link and use the
1339 actual on-disk "real path" of the module as both an identifier and as a root
1343 be thrown if <code>moduleA</code> attempts to require <code>moduleB</code> as a peer dependency:</p>
1344 <pre><code class="language-text">{appDir}
1348 │ ├── moduleA -> {appDir}/moduleA
1354 └── package.json</code> <button class="copy-button">copy</button></pre>
1355 <p>The <code>--preserve-symlinks</code> command-line flag instructs Node.js to use the
1358 <p>Note, however, that using <code>--preserve-symlinks</code> can have other side effects.
1363 <p>The <code>--preserve-symlinks</code> flag does not apply to the main module, which allows
1364 <code>node --preserve-symlinks node_module/.bin/<foo></code> to work. To apply the same
1365 behavior for the main module, also use <code>--preserve-symlinks-main</code>.</p>
1366 <h4><code>--preserve-symlinks-main</code><span><a class="mark" href="#--preserve-symlinks-main" id=…
1371 caching the main module (<code>require.main</code>).</p>
1372 <p>This flag exists so that the main module can be opted-in to the same behavior
1373 that <code>--preserve-symlinks</code> gives to all other imports; they are separate flags,
1375 <p><code>--preserve-symlinks-main</code> does not imply <code>--preserve-symlinks</code>; use
1376 <code>--preserve-symlinks-main</code> in addition to
1377 <code>--preserve-symlinks</code> when it is not desirable to follow symlinks before
1379 <p>See <a href="#--preserve-symlinks"><code>--preserve-symlinks</code></a> for more information.</p>
1380 <h4><code>--prof</code><span><a class="mark" href="#--prof" id="--prof">#</a></span><a aria-hidden=…
1385 <h4><code>--prof-process</code><span><a class="mark" href="#--prof-process" id="--prof-process">#</…
1389 <p>Process V8 profiler output generated using the V8 option <code>--prof</code>.</p>
1390 <h4><code>--redirect-warnings=file</code><span><a class="mark" href="#--redirect-warningsfile" id="…
1398 <p>The <code>file</code> name may be an absolute path. If it is not, the default directory it
1400 <a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir</code></a> command-line option.</p>
1401 <h4><code>--report-compact</code><span><a class="mark" href="#--report-compact" id="--report-compac…
1405 <p>Write reports in a compact format, single-line JSON, more easily consumable
1406 by log processing systems than the default multi-line format designed for
1408 …code>--report-dir=directory</code>, <code>report-directory=directory</code><span><a class="mark" h…
1416 <td><p>Changed from <code>--diagnostic-report-directory</code> to <code>--report-directory</code>.<…
1423 …h4><code>--report-filename=filename</code><span><a class="mark" href="#--report-filenamefilename" …
1431 <td><p>changed from <code>--diagnostic-report-filename</code> to <code>--report-filename</code>.</p…
1438 <p>If the filename is set to <code>'stdout'</code> or <code>'stderr'</code>, the report is written …
1440 <h4><code>--report-on-fatalerror</code><span><a class="mark" href="#--report-on-fatalerror" id="--r…
1448 <td><p>changed from <code>--diagnostic-report-on-fatalerror</code> to <code>--report-on-fatalerror<…
1459 <h4><code>--report-on-signal</code><span><a class="mark" href="#--report-on-signal" id="--report-on…
1467 <td><p>changed from <code>--diagnostic-report-on-signal</code> to <code>--report-on-signal</code>.<…
1475 specified through <code>--report-signal</code>.</p>
1476 <h4><code>--report-signal=signal</code><span><a class="mark" href="#--report-signalsignal" id="--re…
1484 <td><p>changed from <code>--diagnostic-report-signal</code> to <code>--report-signal</code>.</p></t…
1491 Default signal is <code>SIGUSR2</code>.</p>
1492 …<code>--report-uncaught-exception</code><span><a class="mark" href="#--report-uncaught-exception" …
1502 <td><p>changed from <code>--diagnostic-report-uncaught-exception</code> to <code>--report-uncaught-…
1511 <h4><code>--secure-heap=n</code><span><a class="mark" href="#--secure-heapn" id="--secure-heapn">#<…
1515 <p>Initializes an OpenSSL secure heap of <code>n</code> bytes. When initialized, the
1527 …ssl.org/docs/man3.0/man3/CRYPTO_secure_malloc_init.html"><code>CRYPTO_secure_malloc_init</code></a…
1528 <h4><code>--secure-heap-min=n</code><span><a class="mark" href="#--secure-heap-minn" id="--secure-h…
1532 <p>When using <code>--secure-heap</code>, the <code>--secure-heap-min</code> flag specifies the
1533 minimum allocation from the secure heap. The minimum value is <code>2</code>.
1534 The maximum value is the lesser of <code>--secure-heap</code> or <code>2147483647</code>.
1536 <h4><code>--snapshot-blob=path</code><span><a class="mark" href="#--snapshot-blobpath" id="--snapsh…
1540 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1541 <p>When used with <code>--build-snapshot</code>, <code>--snapshot-blob</code> specifies the path
1543 generated blob is written to <code>snapshot.blob</code> in the current working directory.</p>
1544 <p>When used without <code>--build-snapshot</code>, <code>--snapshot-blob</code> specifies the
1554 status code 1.</p>
1555 <h4><code>--test</code><span><a class="mark" href="#--test" id="--test">#</a></span><a aria-hidden=…
1568 <code>--watch-path</code>, <code>--check</code>, <code>--eval</code>, <code>--interactive</code>, o…
1569 See the documentation on <a href="test.html#running-tests-from-the-command-line">running tests from…
1571 <h4><code>--test-concurrency</code><span><a class="mark" href="#--test-concurrency" id="--test-conc…
1576 concurrently. The default value is <code>os.availableParallelism() - 1</code>.</p>
1577 <h4><code>--test-name-pattern</code><span><a class="mark" href="#--test-name-pattern" id="--test-na…
1583 <a href="test.html#filtering-tests-by-name">filtering tests by name</a> for more details.</p>
1584 <h4><code>--test-reporter</code><span><a class="mark" href="#--test-reporter" id="--test-reporter">…
1589 <a href="test.html#test-reporters">test reporters</a> for more details.</p>
1590 …<code>--test-reporter-destination</code><span><a class="mark" href="#--test-reporter-destination" …
1595 <a href="test.html#test-reporters">test reporters</a> for more details.</p>
1596 <h4><code>--test-only</code><span><a class="mark" href="#--test-only" id="--test-only">#</a></span>…
1600 <p>Configures the test runner to only execute top level tests that have the <code>only</code>
1602 <h4><code>--test-shard</code><span><a class="mark" href="#--test-shard" id="--test-shard">#</a></sp…
1606 <p>Test suite shard to execute in a format of <code><index>/<total></code>, where</p>
1607 <p><code>index</code> is a positive integer, index of divided parts
1608 <code>total</code> is a positive integer, total of divided part
1609 This command will divide all tests files into <code>total</code> equal parts,
1610 and will run only those that happen to be in an <code>index</code> part.</p>
1612 <pre><code class="language-bash">node --<span class="hljs-built_in">test</span> --test-shard=1/3
1613 node --<span class="hljs-built_in">test</span> --test-shard=2/3
1614 node --<span class="hljs-built_in">test</span> --test-shard=3/3</code> <button class="copy-button">…
1615 <h4><code>--throw-deprecation</code><span><a class="mark" href="#--throw-deprecation" id="--throw-d…
1620 <h4><code>--title=title</code><span><a class="mark" href="#--titletitle" id="--titletitle">#</a></s…
1624 <p>Set <code>process.title</code> on startup.</p>
1625 <h4><code>--tls-cipher-list=list</code><span><a class="mark" href="#--tls-cipher-listlist" id="--tl…
1631 <h4><code>--tls-keylog=file</code><span><a class="mark" href="#--tls-keylogfile" id="--tls-keylogfi…
1635 <p>Log TLS key material to a file. The key material is in NSS <code>SSLKEYLOGFILE</code>
1638 <h4><code>--tls-max-v1.2</code><span><a class="mark" href="#--tls-max-v12" id="--tls-max-v12">#</a>…
1642 <p>Set <a href="tls.html#tlsdefault_max_version"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1…
1644 <h4><code>--tls-max-v1.3</code><span><a class="mark" href="#--tls-max-v13" id="--tls-max-v13">#</a>…
1648 <p>Set default <a href="tls.html#tlsdefault_max_version"><code>tls.DEFAULT_MAX_VERSION</code></a> t…
1650 <h4><code>--tls-min-v1.0</code><span><a class="mark" href="#--tls-min-v10" id="--tls-min-v10">#</a>…
1654 <p>Set default <a href="tls.html#tlsdefault_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> t…
1656 <h4><code>--tls-min-v1.1</code><span><a class="mark" href="#--tls-min-v11" id="--tls-min-v11">#</a>…
1660 <p>Set default <a href="tls.html#tlsdefault_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> t…
1662 <h4><code>--tls-min-v1.2</code><span><a class="mark" href="#--tls-min-v12" id="--tls-min-v12">#</a>…
1666 <p>Set default <a href="tls.html#tlsdefault_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> t…
1669 <h4><code>--tls-min-v1.3</code><span><a class="mark" href="#--tls-min-v13" id="--tls-min-v13">#</a>…
1673 <p>Set default <a href="tls.html#tlsdefault_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> t…
1675 <h4><code>--trace-atomics-wait</code><span><a class="mark" href="#--trace-atomics-wait" id="--trace…
1679 …tability api_stability_0"><a href="documentation.html#stability-index">Stability: 0</a> - Deprecat…
1680 …https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait"><co…
1682 <pre><code class="language-text">(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf…
1687 (node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) started
1689 …ead 1] Atomics.wait(&lt;address> + 4, -1, inf) was woken up by another thread</code> <button …
1692 … as given by <a href="worker_threads.html#workerthreadid"><code>worker_threads.threadId</code></a>…
1693 <li>The base address of the <code>SharedArrayBuffer</code> in question, as well as the
1694 byte offset corresponding to the index passed to <code>Atomics.wait()</code></li>
1695 <li>The expected value that was passed to <code>Atomics.wait()</code></li>
1696 <li>The timeout passed to <code>Atomics.wait</code></li>
1698 <h4><code>--trace-deprecation</code><span><a class="mark" href="#--trace-deprecation" id="--trace-d…
1703 <h4><code>--trace-event-categories</code><span><a class="mark" href="#--trace-event-categories" id=…
1708 tracing is enabled using <code>--trace-events-enabled</code>.</p>
1709 …4><code>--trace-event-file-pattern</code><span><a class="mark" href="#--trace-event-file-pattern" …
1714 supports <code>${rotation}</code> and <code>${pid}</code>.</p>
1715 <h4><code>--trace-events-enabled</code><span><a class="mark" href="#--trace-events-enabled" id="--t…
1720 <h4><code>--trace-exit</code><span><a class="mark" href="#--trace-exit" id="--trace-exit">#</a></sp…
1725 i.e. invoking <code>process.exit()</code>.</p>
1726 <h4><code>--trace-sigint</code><span><a class="mark" href="#--trace-sigint" id="--trace-sigint">#</…
1731 <h4><code>--trace-sync-io</code><span><a class="mark" href="#--trace-sync-io" id="--trace-sync-io">…
1737 <h4><code>--trace-tls</code><span><a class="mark" href="#--trace-tls" id="--trace-tls">#</a></span>…
1741 <p>Prints TLS packet trace information to <code>stderr</code>. This can be used to debug TLS
1743 <h4><code>--trace-uncaught</code><span><a class="mark" href="#--trace-uncaught" id="--trace-uncaugh…
1748 with the creation of an <code>Error</code> is printed, whereas this makes Node.js also
1750 to be an <code>Error</code> instance).</p>
1752 <h4><code>--trace-warnings</code><span><a class="mark" href="#--trace-warnings" id="--trace-warning…
1757 <h4><code>--track-heap-objects</code><span><a class="mark" href="#--track-heap-objects" id="--track…
1762 …><code>--unhandled-rejections=mode</code><span><a class="mark" href="#--unhandled-rejectionsmode" …
1768 <td><p>Changed default mode to <code>throw</code>. Previously, a warning was emitted.</p></td></tr>
1777 <li><code>throw</code>: Emit <a href="process.html#event-unhandledrejection"><code>unhandledRejecti…
1779 <li><code>strict</code>: Raise the unhandled rejection as an uncaught exception. If the
1780 exception is handled, <a href="process.html#event-unhandledrejection"><code>unhandledRejection</cod…
1781 <li><code>warn</code>: Always trigger a warning, no matter if the <a href="process.html#event-unhan…
1783 <li><code>warn-with-error-code</code>: Emit <a href="process.html#event-unhandledrejection"><code>u…
1784 set, trigger a warning, and set the process exit code to 1.</li>
1785 <li><code>none</code>: Silence all warnings.</li>
1789 …code>--use-bundled-ca</code>, <code>--use-openssl-ca</code><span><a class="mark" href="#--use-bund…
1795 at build-time.</p>
1803 <p>See <code>SSL_CERT_DIR</code> and <code>SSL_CERT_FILE</code>.</p>
1804 <h4><code>--use-largepages=mode</code><span><a class="mark" href="#--use-largepagesmode" id="--use-…
1808 <p>Re-map the Node.js static code to large memory pages at startup. If supported on
1809 the target system, this will cause the Node.js static code to be moved onto 2
1811 <p>The following values are valid for <code>mode</code>:</p>
1813 <li><code>off</code>: No mapping will be attempted. This is the default.</li>
1814 <li><code>on</code>: If supported by the OS, mapping will be attempted. Failure to map will
1816 <li><code>silent</code>: If supported by the OS, mapping will be attempted. Failure to map
1819 <h4><code>--v8-options</code><span><a class="mark" href="#--v8-options" id="--v8-options">#</a></sp…
1823 <p>Print V8 command-line options.</p>
1824 <h4><code>--v8-pool-size=num</code><span><a class="mark" href="#--v8-pool-sizenum" id="--v8-pool-si…
1829 <p>If set to <code>0</code> then Node.js will choose an appropriate size of the thread pool
1834 <h4><code>--watch</code><span><a class="mark" href="#--watch" id="--watch">#</a></span><a aria-hidd…
1846 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1852 Use <code>--watch-path</code> to specify what paths to watch.</p>
1854 <code>--check</code>, <code>--eval</code>, <code>--interactive</code>, or the REPL.</p>
1855 …code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"…
1856 <h4><code>--watch-path</code><span><a class="mark" href="#--watch-path" id="--watch-path">#</a></sp…
1860 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
1865 combination with <code>--watch</code>.</p>
1867 <code>--check</code>, <code>--eval</code>, <code>--interactive</code>, <code>--test</code>, or the …
1868 …code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"…
1870 An <code>ERR_FEATURE_UNAVAILABLE_ON_PLATFORM</code> exception will be thrown
1872 <h4><code>--watch-preserve-output</code><span><a class="mark" href="#--watch-preserve-output" id="-…
1874 …code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"…
1875 <h4><code>--zero-fill-buffers</code><span><a class="mark" href="#--zero-fill-buffers" id="--zero-fi…
1879 …o-fills all newly allocated <a href="buffer.html#class-buffer"><code>Buffer</code></a> and <a href…
1881 <h4><code>-c</code>, <code>--check</code><span><a class="mark" href="#-c---check" id="-c---check">#…
1887 <td><p>The <code>--require</code> option is now supported when checking a file.</p></td></tr>
1894 <h4><code>-e</code>, <code>--eval "script"</code><span><a class="mark" href="#-e---eval-script" id=…
1900 <td><p>Built-in libraries are now available as predefined variables.</p></td></tr>
1907 predefined in the REPL can also be used in <code>script</code>.</p>
1908 <p>On Windows, using <code>cmd.exe</code> a single quote will not work correctly because it
1909 only recognizes double <code>"</code> for quoting. In Powershell or Git bash, both <code>'</code>
1910 and <code>"</code> are usable.</p>
1911 <h4><code>-h</code>, <code>--help</code><span><a class="mark" href="#-h---help" id="-h---help">#</a…
1915 <p>Print node command-line options.
1917 <h4><code>-i</code>, <code>--interactive</code><span><a class="mark" href="#-i---interactive" id="-…
1922 <h4><code>-p</code>, <code>--print "script"</code><span><a class="mark" href="#-p---print-script" i…
1928 <td><p>Built-in libraries are now available as predefined variables.</p></td></tr>
1934 <p>Identical to <code>-e</code> but prints the result.</p>
1935 <h4><code>-r</code>, <code>--require module</code><span><a class="mark" href="#-r---require-module"…
1940 <p>Follows <code>require()</code>'s module resolution
1941 rules. <code>module</code> may be either a path to a file, or a node module name.</p>
1943 Use <a href="#--importmodule"><code>--import</code></a> to preload an <a href="esm.html#modules-ecm…
1944 Modules preloaded with <code>--require</code> will run before modules preloaded with <code>--import…
1945 <h4><code>-v</code>, <code>--version</code><span><a class="mark" href="#-v---version" id="-v---vers…
1950 …riables<span><a class="mark" href="#environment-variables" id="environment-variables">#</a></span>…
1951 <h4><code>FORCE_COLOR=[1, 2, 3]</code><span><a class="mark" href="#force_color1-2-3" id="force_colo…
1952 <p>The <code>FORCE_COLOR</code> environment variable is used to
1955 <li><code>1</code>, <code>true</code>, or the empty string <code>''</code> indicate 16-color suppor…
1956 <li><code>2</code> to indicate 256-color support, or</li>
1957 <li><code>3</code> to indicate 16 million-color support.</li>
1959 <p>When <code>FORCE_COLOR</code> is used and set to a supported value, both the <code>NO_COLOR</cod…
1960 and <code>NODE_DISABLE_COLORS</code> environment variables are ignored.</p>
1962 <h4><code>NODE_DEBUG=module[,…]</code><span><a class="mark" href="#node_debugmodule" id="node_debug…
1966 <p><code>','</code>-separated list of core modules that should print debug information.</p>
1967 <h4><code>NODE_DEBUG_NATIVE=module[,…]</code><span><a class="mark" href="#node_debug_nativemodule" …
1968 <p><code>','</code>-separated list of core C++ modules that should print debug information.</p>
1969 <h4><code>NODE_DISABLE_COLORS=1</code><span><a class="mark" href="#node_disable_colors1" id="node_d…
1974 <h4><code>NODE_EXTRA_CA_CERTS=file</code><span><a class="mark" href="#node_extra_ca_certsfile" id="…
1979 extra certificates in <code>file</code>. The file should consist of one or more trusted
1981 <a href="process.html#processemitwarningwarning-options"><code>process.emitWarning()</code></a> if …
1983 <p>Neither the well known nor extra certificates are used when the <code>ca</code>
1985 <p>This environment variable is ignored when <code>node</code> runs as setuid root or
1987 <p>The <code>NODE_EXTRA_CA_CERTS</code> environment variable is only read when the Node.js
1989 <code>process.env.NODE_EXTRA_CA_CERTS</code> has no effect on the current process.</p>
1990 <h4><code>NODE_ICU_DATA=file</code><span><a class="mark" href="#node_icu_datafile" id="node_icu_dat…
1994 <p>Data path for ICU (<code>Intl</code> object) data. Will extend linked-in data when compiled
1995 with small-icu support.</p>
1996 <h4><code>NODE_NO_WARNINGS=1</code><span><a class="mark" href="#node_no_warnings1" id="node_no_warn…
2000 <p>When set to <code>1</code>, process warnings are silenced.</p>
2001 <h4><code>NODE_OPTIONS=options...</code><span><a class="mark" href="#node_optionsoptions" id="node_…
2005 <p>A space-separated list of command-line options. <code>options...</code> are interpreted
2006 before command-line options, so command-line options will override or
2007 compound after anything in <code>options...</code>. Node.js will exit with an error if
2008 an option that is not allowed in the environment is used, such as <code>-p</code> or a
2011 <pre><code class="language-bash">NODE_OPTIONS=<span class="hljs-string">'--require "./my path/file.…
2012 <p>A singleton flag passed as a command-line option will override the same flag
2013 passed into <code>NODE_OPTIONS</code>:</p>
2014 <pre><code class="language-bash"><span class="hljs-comment"># The inspector will be available on po…
2015 …_OPTIONS=<span class="hljs-string">'--inspect=localhost:4444'</span> node --inspect=localhost:5555…
2017 <code>NODE_OPTIONS</code> instances were passed first, and then its command-line
2019 <pre><code class="language-bash">NODE_OPTIONS=<span class="hljs-string">'--require "./a.js"'</span>…
2020 <span class="hljs-comment"># is equivalent to:</span>
2021 node --require <span class="hljs-string">"./a.js"</span> --require <span class="hljs-string">"./b.j…
2023 <!-- node-options-node start -->
2025 <li><code>--conditions</code>, <code>-C</code></li>
2026 <li><code>--diagnostic-dir</code></li>
2027 <li><code>--disable-proto</code></li>
2028 <li><code>--dns-result-order</code></li>
2029 <li><code>--enable-fips</code></li>
2030 <li><code>--enable-network-family-autoselection</code></li>
2031 <li><code>--enable-source-maps</code></li>
2032 <li><code>--experimental-abortcontroller</code></li>
2033 <li><code>--experimental-default-type</code></li>
2034 <li><code>--experimental-global-customevent</code></li>
2035 <li><code>--experimental-global-webcrypto</code></li>
2036 <li><code>--experimental-import-meta-resolve</code></li>
2037 <li><code>--experimental-json-modules</code></li>
2038 <li><code>--experimental-loader</code></li>
2039 <li><code>--experimental-modules</code></li>
2040 <li><code>--experimental-network-imports</code></li>
2041 <li><code>--experimental-policy</code></li>
2042 <li><code>--experimental-shadow-realm</code></li>
2043 <li><code>--experimental-specifier-resolution</code></li>
2044 <li><code>--experimental-top-level-await</code></li>
2045 <li><code>--experimental-vm-modules</code></li>
2046 <li><code>--experimental-wasi-unstable-preview1</code></li>
2047 <li><code>--experimental-wasm-modules</code></li>
2048 <li><code>--force-context-aware</code></li>
2049 <li><code>--force-fips</code></li>
2050 <li><code>--force-node-api-uncaught-exceptions-policy</code></li>
2051 <li><code>--frozen-intrinsics</code></li>
2052 <li><code>--heapsnapshot-near-heap-limit</code></li>
2053 <li><code>--heapsnapshot-signal</code></li>
2054 <li><code>--http-parser</code></li>
2055 <li><code>--icu-data-dir</code></li>
2056 <li><code>--import</code></li>
2057 <li><code>--input-type</code></li>
2058 <li><code>--insecure-http-parser</code></li>
2059 <li><code>--inspect-brk</code></li>
2060 <li><code>--inspect-port</code>, <code>--debug-port</code></li>
2061 <li><code>--inspect-publish-uid</code></li>
2062 <li><code>--inspect</code></li>
2063 <li><code>--max-http-header-size</code></li>
2064 <li><code>--napi-modules</code></li>
2065 <li><code>--no-addons</code></li>
2066 <li><code>--no-deprecation</code></li>
2067 <li><code>--no-experimental-fetch</code></li>
2068 <li><code>--no-experimental-repl-await</code></li>
2069 <li><code>--no-extra-info-on-fatal-exception</code></li>
2070 <li><code>--no-force-async-hooks-checks</code></li>
2071 <li><code>--no-global-search-paths</code></li>
2072 <li><code>--no-warnings</code></li>
2073 <li><code>--node-memory-debug</code></li>
2074 <li><code>--openssl-config</code></li>
2075 <li><code>--openssl-legacy-provider</code></li>
2076 <li><code>--openssl-shared-config</code></li>
2077 <li><code>--pending-deprecation</code></li>
2078 <li><code>--policy-integrity</code></li>
2079 <li><code>--preserve-symlinks-main</code></li>
2080 <li><code>--preserve-symlinks</code></li>
2081 <li><code>--prof-process</code></li>
2082 <li><code>--redirect-warnings</code></li>
2083 <li><code>--report-compact</code></li>
2084 <li><code>--report-dir</code>, <code>--report-directory</code></li>
2085 <li><code>--report-filename</code></li>
2086 <li><code>--report-on-fatalerror</code></li>
2087 <li><code>--report-on-signal</code></li>
2088 <li><code>--report-signal</code></li>
2089 <li><code>--report-uncaught-exception</code></li>
2090 <li><code>--require</code>, <code>-r</code></li>
2091 <li><code>--secure-heap-min</code></li>
2092 <li><code>--secure-heap</code></li>
2093 <li><code>--snapshot-blob</code></li>
2094 <li><code>--test-only</code></li>
2095 <li><code>--test-reporter-destination</code></li>
2096 <li><code>--test-reporter</code></li>
2097 <li><code>--test-shard</code></li>
2098 <li><code>--throw-deprecation</code></li>
2099 <li><code>--title</code></li>
2100 <li><code>--tls-cipher-list</code></li>
2101 <li><code>--tls-keylog</code></li>
2102 <li><code>--tls-max-v1.2</code></li>
2103 <li><code>--tls-max-v1.3</code></li>
2104 <li><code>--tls-min-v1.0</code></li>
2105 <li><code>--tls-min-v1.1</code></li>
2106 <li><code>--tls-min-v1.2</code></li>
2107 <li><code>--tls-min-v1.3</code></li>
2108 <li><code>--trace-atomics-wait</code></li>
2109 <li><code>--trace-deprecation</code></li>
2110 <li><code>--trace-event-categories</code></li>
2111 <li><code>--trace-event-file-pattern</code></li>
2112 <li><code>--trace-events-enabled</code></li>
2113 <li><code>--trace-exit</code></li>
2114 <li><code>--trace-sigint</code></li>
2115 <li><code>--trace-sync-io</code></li>
2116 <li><code>--trace-tls</code></li>
2117 <li><code>--trace-uncaught</code></li>
2118 <li><code>--trace-warnings</code></li>
2119 <li><code>--track-heap-objects</code></li>
2120 <li><code>--unhandled-rejections</code></li>
2121 <li><code>--use-bundled-ca</code></li>
2122 <li><code>--use-largepages</code></li>
2123 <li><code>--use-openssl-ca</code></li>
2124 <li><code>--v8-pool-size</code></li>
2125 <li><code>--watch-path</code></li>
2126 <li><code>--watch-preserve-output</code></li>
2127 <li><code>--watch</code></li>
2128 <li><code>--zero-fill-buffers</code></li>
2130 <!-- node-options-node end -->
2132 <!-- node-options-v8 start -->
2134 <li><code>--abort-on-uncaught-exception</code></li>
2135 <li><code>--disallow-code-generation-from-strings</code></li>
2136 <li><code>--enable-etw-stack-walking</code></li>
2137 <li><code>--huge-max-old-generation-size</code></li>
2138 <li><code>--interpreted-frames-native-stack</code></li>
2139 <li><code>--jitless</code></li>
2140 <li><code>--max-old-space-size</code></li>
2141 <li><code>--max-semi-space-size</code></li>
2142 <li><code>--perf-basic-prof-only-functions</code></li>
2143 <li><code>--perf-basic-prof</code></li>
2144 <li><code>--perf-prof-unwinding-info</code></li>
2145 <li><code>--perf-prof</code></li>
2146 <li><code>--stack-trace-limit</code></li>
2148 <!-- node-options-v8 end -->
2149 <p><code>--perf-basic-prof-only-functions</code>, <code>--perf-basic-prof</code>,
2150 <code>--perf-prof-unwinding-info</code>, and <code>--perf-prof</code> are only available on Linux.<…
2151 <p><code>--enable-etw-stack-walking</code> is only available on Windows.</p>
2152 <h4><code>NODE_PATH=path[:…]</code><span><a class="mark" href="#node_pathpath" id="node_pathpath">#…
2156 <p><code>':'</code>-separated list of directories prefixed to the module search path.</p>
2157 <p>On Windows, this is a <code>';'</code>-separated list instead.</p>
2158 …h4><code>NODE_PENDING_DEPRECATION=1</code><span><a class="mark" href="#node_pending_deprecation1" …
2162 <p>When set to <code>1</code>, emit pending deprecation warnings.</p>
2165 unless either the <code>--pending-deprecation</code> command-line flag, or the
2166 <code>NODE_PENDING_DEPRECATION=1</code> environment variable, is set. Pending deprecations
2169 …code>NODE_PENDING_PIPE_INSTANCES=instances</code><span><a class="mark" href="#node_pending_pipe_in…
2172 <h4><code>NODE_PRESERVE_SYMLINKS=1</code><span><a class="mark" href="#node_preserve_symlinks1" id="…
2176 <p>When set to <code>1</code>, instructs the module loader to preserve symbolic links when
2178 …><code>NODE_REDIRECT_WARNINGS=file</code><span><a class="mark" href="#node_redirect_warningsfile" …
2186 equivalent to using the <code>--redirect-warnings=file</code> command-line flag.</p>
2187 <h4><code>NODE_REPL_HISTORY=file</code><span><a class="mark" href="#node_repl_historyfile" id="node…
2192 <code>~/.node_repl_history</code>, which is overridden by this variable. Setting the value
2193 to an empty string (<code>''</code> or <code>' '</code>) disables persistent REPL history.</p>
2194 …code>NODE_REPL_EXTERNAL_MODULE=file</code><span><a class="mark" href="#node_repl_external_modulefi…
2198 <p>Path to a Node.js module which will be loaded in place of the built-in REPL.
2199 Overriding this value to an empty string (<code>''</code>) will use the built-in REPL.</p>
2200 …code>NODE_SKIP_PLATFORM_CHECK=value</code><span><a class="mark" href="#node_skip_platform_checkval…
2204 <p>If <code>value</code> equals <code>'1'</code>, the check for a supported platform is skipped dur…
2207 <h4><code>NODE_TEST_CONTEXT=value</code><span><a class="mark" href="#node_test_contextvalue" id="no…
2208 <p>If <code>value</code> equals <code>'child'</code>, test reporter options will be overridden and …
2211 …code>NODE_TLS_REJECT_UNAUTHORIZED=value</code><span><a class="mark" href="#node_tls_reject_unautho…
2212 <p>If <code>value</code> equals <code>'0'</code>, certificate validation is disabled for TLS connec…
2215 <h4><code>NODE_V8_COVERAGE=dir</code><span><a class="mark" href="#node_v8_coveragedir" id="node_v8_…
2216 …a href="https://v8project.blogspot.com/2017/12/javascript-code-coverage.html">V8 JavaScript code c…
2218 information is written as JSON to files with a <code>coverage</code> prefix).</p>
2219 <p><code>NODE_V8_COVERAGE</code> will automatically propagate to subprocesses, making it
2220 easier to instrument applications that call the <code>child_process.spawn()</code> family
2221 of functions. <code>NODE_V8_COVERAGE</code> can be set to an empty string, to prevent
2223 …overage output<span><a class="mark" href="#coverage-output" id="coverage-output">#</a></span><a ar…
2224 …//chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage">ScriptCoverage</a> …
2225 key <code>result</code>:</p>
2226 <pre><code class="language-json"><span class="hljs-punctuation">{</span>
2227 …<span class="hljs-attr">"result"</span><span class="hljs-punctuation">:</span> <span class="hljs-p…
2228 <span class="hljs-punctuation">{</span>
2229 …<span class="hljs-attr">"scriptId"</span><span class="hljs-punctuation">:</span> <span class="hljs…
2230 …n class="hljs-attr">"url"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">…
2231 …pan class="hljs-attr">"functions"</span><span class="hljs-punctuation">:</span> <span class="hljs-…
2232 <span class="hljs-punctuation">}</span>
2233 <span class="hljs-punctuation">]</span>
2234 <span class="hljs-punctuation">}</span></code> <button class="copy-button">copy</button></pre>
2235 …urce map cache<span><a class="mark" href="#source-map-cache" id="source-map-cache">#</a></span><a …
2236 …tability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experime…
2237 <p>If found, source map data is appended to the top-level key <code>source-map-cache</code>
2239 <p><code>source-map-cache</code> is an object with keys representing the files source maps
2240 were extracted from, and values which include the raw source-map URL
2241 (in the key <code>url</code>), the parsed Source Map v3 information (in the key <code>data</code>),
2242 and the line lengths of the source file (in the key <code>lineLengths</code>).</p>
2243 <pre><code class="language-json"><span class="hljs-punctuation">{</span>
2244 …<span class="hljs-attr">"result"</span><span class="hljs-punctuation">:</span> <span class="hljs-p…
2245 <span class="hljs-punctuation">{</span>
2246 …<span class="hljs-attr">"scriptId"</span><span class="hljs-punctuation">:</span> <span class="hljs…
2247 …ljs-attr">"url"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"file:///a…
2248 …pan class="hljs-attr">"functions"</span><span class="hljs-punctuation">:</span> <span class="hljs-…
2249 <span class="hljs-punctuation">}</span>
2250 <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
2251 …<span class="hljs-attr">"source-map-cache"</span><span class="hljs-punctuation">:</span> <span cla…
2252 …<span class="hljs-attr">"file:///absolute/path/to/source.js"</span><span class="hljs-punctuation">…
2253 …class="hljs-attr">"url"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">".…
2254 …<span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-pun…
2255 …<span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-…
2256 …<span class="hljs-attr">"sources"</span><span class="hljs-punctuation">:</span> <span class="hljs-…
2257 <span class="hljs-string">"file:///absolute/path/to/original.js"</span>
2258 <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
2259 …<span class="hljs-attr">"names"</span><span class="hljs-punctuation">:</span> <span class="hljs-pu…
2260 <span class="hljs-string">"Foo"</span><span class="hljs-punctuation">,</span>
2261 <span class="hljs-string">"console"</span><span class="hljs-punctuation">,</span>
2262 <span class="hljs-string">"info"</span>
2263 <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
2264 …ass="hljs-attr">"mappings"</span><span class="hljs-punctuation">:</span> <span class="hljs-string"…
2265 …<span class="hljs-attr">"sourceRoot"</span><span class="hljs-punctuation">:</span> <span class="hl…
2266 <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
2267 …<span class="hljs-attr">"lineLengths"</span><span class="hljs-punctuation">:</span> <span class="h…
2268 <span class="hljs-number">13</span><span class="hljs-punctuation">,</span>
2269 <span class="hljs-number">62</span><span class="hljs-punctuation">,</span>
2270 <span class="hljs-number">38</span><span class="hljs-punctuation">,</span>
2271 <span class="hljs-number">27</span>
2272 <span class="hljs-punctuation">]</span>
2273 <span class="hljs-punctuation">}</span>
2274 <span class="hljs-punctuation">}</span>
2275 <span class="hljs-punctuation">}</span></code> <button class="copy-button">copy</button></pre>
2276 <h4><code>NO_COLOR=<any></code><span><a class="mark" href="#no_colorany" id="no_colorany">#</a…
2277 <p><a href="https://no-color.org"><code>NO_COLOR</code></a> is an alias for <code>NODE_DISABLE_COL…
2279 <h4><code>OPENSSL_CONF=file</code><span><a class="mark" href="#openssl_conffile" id="openssl_conffi…
2284 used to enable FIPS-compliant crypto if Node.js is built with
2285 <code>./configure --openssl-fips</code>.</p>
2286 <p>If the <a href="#--openssl-configfile"><code>--openssl-config</code></a> command-line option is …
2288 <h4><code>SSL_CERT_DIR=dir</code><span><a class="mark" href="#ssl_cert_dirdir" id="ssl_cert_dirdir"…
2292 <p>If <code>--use-openssl-ca</code> is enabled, this overrides and sets OpenSSL's directory
2297 <h4><code>SSL_CERT_FILE=file</code><span><a class="mark" href="#ssl_cert_filefile" id="ssl_cert_fil…
2301 <p>If <code>--use-openssl-ca</code> is enabled, this overrides and sets OpenSSL's file
2306 <h4><code>TZ</code><span><a class="mark" href="#tz" id="tz">#</a></span><a aria-hidden="true" class…
2320 <p>The <code>TZ</code> environment variable is used to specify the timezone configuration.</p>
2321 …f="https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html">ways that <code>TZ</code> …
2323 <code>'Etc/UTC'</code>, <code>'Europe/Paris'</code>, or <code>'America/New_York'</code>).
2326 …pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-…
2327 Wed May 12 2021 20:30:48 GMT+0100 (Irish Standard Time)</code> <button class="copy-button">copy</bu…
2328 <h4><code>UV_THREADPOOL_SIZE=size</code><span><a class="mark" href="#uv_threadpool_sizesize" id="uv…
2329 <p>Set the number of threads used in libuv's threadpool to <code>size</code> threads.</p>
2334 <li>all <code>fs</code> APIs, other than the file watcher APIs and those that are explicitly
2336 <li>asynchronous crypto APIs such as <code>crypto.pbkdf2()</code>, <code>crypto.scrypt()</code>,
2337 <code>crypto.randomBytes()</code>, <code>crypto.randomFill()</code>, <code>crypto.generateKeyPair()…
2338 <li><code>dns.lookup()</code></li>
2339 <li>all <code>zlib</code> APIs, other than those that are explicitly synchronous</li>
2345 threadpool by setting the <code>'UV_THREADPOOL_SIZE'</code> environment variable to a value
2346 greater than <code>4</code> (its current default value). For more information, see the
2348 …ul V8 options<span><a class="mark" href="#useful-v8-options" id="useful-v8-options">#</a></span><a…
2349 <p>V8 has its own set of CLI options. Any V8 CLI option that is provided to <code>node</code>
2357 …code>--max-old-space-size=SIZE</code> (in megabytes)<span><a class="mark" href="#--max-old-space-s…
2363 …code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"…
2364 …code>--max-semi-space-size=SIZE</code> (in megabytes)<span><a class="mark" href="#--max-semi-space…
2365 …ment.org/glossary/s.html#semi.space">semi-space</a> size for V8's <a href="https://v8.dev/blog/ori…
2367 Increasing the max size of a semi-space may improve throughput for Node.js at
2370 …ags/10.3.129/src/heap/heap.cc#328"><code>YoungGenerationSizeFromSemiSpaceSize</code></a> in V8) th…
2371 an increase of 1 MiB to semi-space applies to each of the three individual
2372 semi-spaces and causes the heap size to increase by 3 MiB. The throughput
2374 <p>The default value is 16 MiB for 64-bit systems and 8 MiB for 32-bit systems. To
2376 max-semi-space-size values when running benchmarks for your application.</p>
2377 <p>For example, benchmark on a 64-bit systems:</p>
2378 <pre><code class="language-bash"><span class="hljs-keyword">for</span> MiB <span class="hljs-keywor…
2379 node --max-semi-space-size=<span class="hljs-variable">$MiB</span> index.js
2380 <span class="hljs-keyword">done</span></code> <button class="copy-button">copy</button></pre></sect…
2381 <!-- API END -->