• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<html lang="en">
3<head>
4  <meta charset="utf-8">
5  <meta name="viewport" content="width=device-width">
6  <meta name="nodejs.org:node-version" content="v14.21.2">
7  <title>Command-line options | Node.js v14.21.2 Documentation</title>
8  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic&display=fallback">
9  <link rel="stylesheet" href="assets/style.css">
10  <link rel="stylesheet" href="assets/hljs.css">
11  <link rel="canonical" href="https://nodejs.org/api/cli.html">
12</head>
13<body class="alt apidoc" id="api-section-cli">
14  <div id="content" class="clearfix">
15    <div id="column2" class="interior">
16      <div id="intro" class="interior">
17        <a href="/" title="Go back to the home page">
18          Node.js
19        </a>
20      </div>
21      <ul>
22<li><a href="documentation.html" class="nav-documentation">About this documentation</a></li>
23<li><a href="synopsis.html" class="nav-synopsis">Usage and example</a></li>
24</ul>
25<hr class="line">
26<ul>
27<li><a href="assert.html" class="nav-assert">Assertion testing</a></li>
28<li><a href="async_hooks.html" class="nav-async_hooks">Async hooks</a></li>
29<li><a href="buffer.html" class="nav-buffer">Buffer</a></li>
30<li><a href="addons.html" class="nav-addons">C++ addons</a></li>
31<li><a href="n-api.html" class="nav-n-api">C/C++ addons with Node-API</a></li>
32<li><a href="embedding.html" class="nav-embedding">C++ embedder API</a></li>
33<li><a href="child_process.html" class="nav-child_process">Child processes</a></li>
34<li><a href="cluster.html" class="nav-cluster">Cluster</a></li>
35<li><a href="cli.html" class="nav-cli active">Command-line options</a></li>
36<li><a href="console.html" class="nav-console">Console</a></li>
37<li><a href="corepack.html" class="nav-corepack">Corepack</a></li>
38<li><a href="crypto.html" class="nav-crypto">Crypto</a></li>
39<li><a href="debugger.html" class="nav-debugger">Debugger</a></li>
40<li><a href="deprecations.html" class="nav-deprecations">Deprecated APIs</a></li>
41<li><a href="diagnostics_channel.html" class="nav-diagnostics_channel">Diagnostics Channel</a></li>
42<li><a href="dns.html" class="nav-dns">DNS</a></li>
43<li><a href="domain.html" class="nav-domain">Domain</a></li>
44<li><a href="errors.html" class="nav-errors">Errors</a></li>
45<li><a href="events.html" class="nav-events">Events</a></li>
46<li><a href="fs.html" class="nav-fs">File system</a></li>
47<li><a href="globals.html" class="nav-globals">Globals</a></li>
48<li><a href="http.html" class="nav-http">HTTP</a></li>
49<li><a href="http2.html" class="nav-http2">HTTP/2</a></li>
50<li><a href="https.html" class="nav-https">HTTPS</a></li>
51<li><a href="inspector.html" class="nav-inspector">Inspector</a></li>
52<li><a href="intl.html" class="nav-intl">Internationalization</a></li>
53<li><a href="modules.html" class="nav-modules">Modules: CommonJS modules</a></li>
54<li><a href="esm.html" class="nav-esm">Modules: ECMAScript modules</a></li>
55<li><a href="module.html" class="nav-module">Modules: <code>module</code> API</a></li>
56<li><a href="packages.html" class="nav-packages">Modules: Packages</a></li>
57<li><a href="net.html" class="nav-net">Net</a></li>
58<li><a href="os.html" class="nav-os">OS</a></li>
59<li><a href="path.html" class="nav-path">Path</a></li>
60<li><a href="perf_hooks.html" class="nav-perf_hooks">Performance hooks</a></li>
61<li><a href="policy.html" class="nav-policy">Policies</a></li>
62<li><a href="process.html" class="nav-process">Process</a></li>
63<li><a href="punycode.html" class="nav-punycode">Punycode</a></li>
64<li><a href="querystring.html" class="nav-querystring">Query strings</a></li>
65<li><a href="readline.html" class="nav-readline">Readline</a></li>
66<li><a href="repl.html" class="nav-repl">REPL</a></li>
67<li><a href="report.html" class="nav-report">Report</a></li>
68<li><a href="stream.html" class="nav-stream">Stream</a></li>
69<li><a href="string_decoder.html" class="nav-string_decoder">String decoder</a></li>
70<li><a href="timers.html" class="nav-timers">Timers</a></li>
71<li><a href="tls.html" class="nav-tls">TLS/SSL</a></li>
72<li><a href="tracing.html" class="nav-tracing">Trace events</a></li>
73<li><a href="tty.html" class="nav-tty">TTY</a></li>
74<li><a href="dgram.html" class="nav-dgram">UDP/datagram</a></li>
75<li><a href="url.html" class="nav-url">URL</a></li>
76<li><a href="util.html" class="nav-util">Utilities</a></li>
77<li><a href="v8.html" class="nav-v8">V8</a></li>
78<li><a href="vm.html" class="nav-vm">VM</a></li>
79<li><a href="wasi.html" class="nav-wasi">WASI</a></li>
80<li><a href="worker_threads.html" class="nav-worker_threads">Worker threads</a></li>
81<li><a href="zlib.html" class="nav-zlib">Zlib</a></li>
82</ul>
83<hr class="line">
84<ul>
85<li><a href="https://github.com/nodejs/node" class="nav-https-github-com-nodejs-node">Code repository and issue tracker</a></li>
86</ul>
87    </div>
88
89    <div id="column1" data-id="cli" class="interior">
90      <header>
91        <div class="header-container">
92          <h1>Node.js v14.21.2 documentation</h1>
93          <button class="theme-toggle-btn" id="theme-toggle-btn" title="Toggle dark mode/light mode" aria-label="Toggle dark mode/light mode" hidden>
94            <svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" height="24" width="24">
95              <path fill="none" d="M0 0h24v24H0z" />
96              <path d="M11.1 12.08c-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.66 0 3.18.83 4.1 2.15A4.01 4.01 0 0111 18c0 1.52-.87 2.83-2.12 3.51.98.32 2.03.5 3.11.5 3.5 0 6.58-1.8 8.37-4.52-2.36.23-6.98-.97-9.26-5.41z"/>
97              <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-2z"/>
98            </svg>
99            <svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" height="24" width="24">
100              <path d="M0 0h24v24H0z" fill="none" />
101              <path d="M6.76 4.84l-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.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"/>
102            </svg>
103          </button>
104        </div>
105        <div id="gtoc">
106          <ul>
107            <li>
108              <a href="index.html">Index</a>
109            </li>
110            <li>
111              <a href="all.html">View on single page</a>
112            </li>
113            <li>
114              <a href="cli.json">View as JSON</a>
115            </li>
116
117    <li class="version-picker">
118      <a href="#">View another version <span>&#x25bc;</span></a>
119      <ol class="version-picker"><li><a href="https://nodejs.org/docs/latest-v19.x/api/cli.html">19.x</a></li>
120<li><a href="https://nodejs.org/docs/latest-v18.x/api/cli.html">18.x <b>LTS</b></a></li>
121<li><a href="https://nodejs.org/docs/latest-v17.x/api/cli.html">17.x</a></li>
122<li><a href="https://nodejs.org/docs/latest-v16.x/api/cli.html">16.x <b>LTS</b></a></li>
123<li><a href="https://nodejs.org/docs/latest-v15.x/api/cli.html">15.x</a></li>
124<li><a href="https://nodejs.org/docs/latest-v14.x/api/cli.html">14.x <b>LTS</b></a></li>
125<li><a href="https://nodejs.org/docs/latest-v13.x/api/cli.html">13.x</a></li>
126<li><a href="https://nodejs.org/docs/latest-v12.x/api/cli.html">12.x</a></li>
127<li><a href="https://nodejs.org/docs/latest-v11.x/api/cli.html">11.x</a></li>
128<li><a href="https://nodejs.org/docs/latest-v10.x/api/cli.html">10.x</a></li>
129<li><a href="https://nodejs.org/docs/latest-v9.x/api/cli.html">9.x</a></li>
130<li><a href="https://nodejs.org/docs/latest-v8.x/api/cli.html">8.x</a></li>
131<li><a href="https://nodejs.org/docs/latest-v7.x/api/cli.html">7.x</a></li>
132<li><a href="https://nodejs.org/docs/latest-v6.x/api/cli.html">6.x</a></li>
133<li><a href="https://nodejs.org/docs/latest-v5.x/api/cli.html">5.x</a></li></ol>
134    </li>
135
136            <li class="edit_on_github"><a href="https://github.com/nodejs/node/edit/master/doc/api/cli.md">Edit on GitHub</a></li>
137          </ul>
138        </div>
139        <hr>
140      </header>
141
142      <details id="toc" open><summary>Table of contents</summary><ul>
143<li><a href="#cli_command_line_options">Command-line options</a>
144<ul>
145<li><a href="#cli_synopsis">Synopsis</a></li>
146<li><a href="#cli_options">Options</a>
147<ul>
148<li><a href="#cli"><code>-</code></a></li>
149<li><a href="#cli_1"><code>--</code></a></li>
150<li><a href="#cli_abort_on_uncaught_exception"><code>--abort-on-uncaught-exception</code></a></li>
151<li><a href="#cli_completion_bash"><code>--completion-bash</code></a></li>
152<li><span class="stability_1"><a href="#cli_c_condition_conditions_condition"><code>-C=condition</code>, <code>--conditions=condition</code></a></span></li>
153<li><span class="stability_1"><a href="#cli_cpu_prof"><code>--cpu-prof</code></a></span></li>
154<li><span class="stability_1"><a href="#cli_cpu_prof_dir"><code>--cpu-prof-dir</code></a></span></li>
155<li><span class="stability_1"><a href="#cli_cpu_prof_interval"><code>--cpu-prof-interval</code></a></span></li>
156<li><span class="stability_1"><a href="#cli_cpu_prof_name"><code>--cpu-prof-name</code></a></span></li>
157<li><a href="#cli_diagnostic_dir_directory"><code>--diagnostic-dir=directory</code></a></li>
158<li><a href="#cli_disable_proto_mode"><code>--disable-proto=mode</code></a></li>
159<li><a href="#cli_disallow_code_generation_from_strings"><code>--disallow-code-generation-from-strings</code></a></li>
160<li><a href="#cli_dns_result_order_order"><code>--dns-result-order=order</code></a></li>
161<li><a href="#cli_enable_fips"><code>--enable-fips</code></a></li>
162<li><a href="#cli_enable_source_maps"><code>--enable-source-maps</code></a></li>
163<li><a href="#cli_experimental_abortcontroller"><code>--experimental-abortcontroller</code></a></li>
164<li><a href="#cli_experimental_import_meta_resolve"><code>--experimental-import-meta-resolve</code></a></li>
165<li><a href="#cli_experimental_json_modules"><code>--experimental-json-modules</code></a></li>
166<li><a href="#cli_experimental_loader_module"><code>--experimental-loader=module</code></a></li>
167<li><a href="#cli_experimental_modules"><code>--experimental-modules</code></a></li>
168<li><a href="#cli_experimental_policy"><code>--experimental-policy</code></a></li>
169<li><a href="#cli_experimental_repl_await"><code>--experimental-repl-await</code></a></li>
170<li><a href="#cli_experimental_specifier_resolution_mode"><code>--experimental-specifier-resolution=mode</code></a></li>
171<li><a href="#cli_experimental_vm_modules"><code>--experimental-vm-modules</code></a></li>
172<li><a href="#cli_experimental_wasi_unstable_preview1"><code>--experimental-wasi-unstable-preview1</code></a></li>
173<li><a href="#cli_experimental_wasm_modules"><code>--experimental-wasm-modules</code></a></li>
174<li><a href="#cli_force_context_aware"><code>--force-context-aware</code></a></li>
175<li><a href="#cli_force_fips"><code>--force-fips</code></a></li>
176<li><span class="stability_1"><a href="#cli_frozen_intrinsics"><code>--frozen-intrinsics</code></a></span></li>
177<li><span class="stability_1"><a href="#cli_heapsnapshot_near_heap_limit_max_count"><code>--heapsnapshot-near-heap-limit=max_count</code></a></span></li>
178<li><a href="#cli_heapsnapshot_signal_signal"><code>--heapsnapshot-signal=signal</code></a></li>
179<li><span class="stability_1"><a href="#cli_heap_prof"><code>--heap-prof</code></a></span></li>
180<li><span class="stability_1"><a href="#cli_heap_prof_dir"><code>--heap-prof-dir</code></a></span></li>
181<li><span class="stability_1"><a href="#cli_heap_prof_interval"><code>--heap-prof-interval</code></a></span></li>
182<li><span class="stability_1"><a href="#cli_heap_prof_name"><code>--heap-prof-name</code></a></span></li>
183<li><a href="#cli_icu_data_dir_file"><code>--icu-data-dir=file</code></a></li>
184<li><a href="#cli_input_type_type"><code>--input-type=type</code></a></li>
185<li><a href="#cli_inspect_brk_host_port"><code>--inspect-brk[=[host:]port]</code></a></li>
186<li><a href="#cli_inspect_port_host_port"><code>--inspect-port=[host:]port</code></a></li>
187<li><a href="#cli_inspect_host_port"><code>--inspect[=[host:]port]</code></a>
188<ul>
189<li><a href="#cli_warning_binding_inspector_to_a_public_ip_port_combination_is_insecure">Warning: binding inspector to a public IP:port combination is insecure</a></li>
190</ul>
191</li>
192<li><a href="#cli_inspect_publish_uid_stderr_http"><code>--inspect-publish-uid=stderr,http</code></a></li>
193<li><a href="#cli_insecure_http_parser"><code>--insecure-http-parser</code></a></li>
194<li><a href="#cli_jitless"><code>--jitless</code></a></li>
195<li><a href="#cli_max_http_header_size_size"><code>--max-http-header-size=size</code></a></li>
196<li><a href="#cli_napi_modules"><code>--napi-modules</code></a></li>
197<li><a href="#cli_no_addons"><code>--no-addons</code></a></li>
198<li><a href="#cli_no_deprecation"><code>--no-deprecation</code></a></li>
199<li><a href="#cli_no_force_async_hooks_checks"><code>--no-force-async-hooks-checks</code></a></li>
200<li><a href="#cli_no_warnings"><code>--no-warnings</code></a></li>
201<li><a href="#cli_node_memory_debug"><code>--node-memory-debug</code></a></li>
202<li><a href="#cli_openssl_config_file"><code>--openssl-config=file</code></a></li>
203<li><a href="#cli_openssl_shared_config"><code>--openssl-shared-config</code></a></li>
204<li><a href="#cli_pending_deprecation"><code>--pending-deprecation</code></a></li>
205<li><span class="stability_1"><a href="#cli_policy_integrity_sri"><code>--policy-integrity=sri</code></a></span></li>
206<li><a href="#cli_preserve_symlinks"><code>--preserve-symlinks</code></a></li>
207<li><a href="#cli_preserve_symlinks_main"><code>--preserve-symlinks-main</code></a></li>
208<li><a href="#cli_prof"><code>--prof</code></a></li>
209<li><a href="#cli_prof_process"><code>--prof-process</code></a></li>
210<li><a href="#cli_redirect_warnings_file"><code>--redirect-warnings=file</code></a></li>
211<li><a href="#cli_report_compact"><code>--report-compact</code></a></li>
212<li><a href="#cli_report_dir_directory_report_directory_directory"><code>--report-dir=directory</code>, <code>report-directory=directory</code></a></li>
213<li><a href="#cli_report_filename_filename"><code>--report-filename=filename</code></a></li>
214<li><a href="#cli_report_on_fatalerror"><code>--report-on-fatalerror</code></a></li>
215<li><a href="#cli_report_on_signal"><code>--report-on-signal</code></a></li>
216<li><a href="#cli_report_signal_signal"><code>--report-signal=signal</code></a></li>
217<li><a href="#cli_report_uncaught_exception"><code>--report-uncaught-exception</code></a></li>
218<li><a href="#cli_throw_deprecation"><code>--throw-deprecation</code></a></li>
219<li><a href="#cli_title_title"><code>--title=title</code></a></li>
220<li><a href="#cli_tls_cipher_list_list"><code>--tls-cipher-list=list</code></a></li>
221<li><a href="#cli_tls_keylog_file"><code>--tls-keylog=file</code></a></li>
222<li><a href="#cli_tls_max_v1_2"><code>--tls-max-v1.2</code></a></li>
223<li><a href="#cli_tls_max_v1_3"><code>--tls-max-v1.3</code></a></li>
224<li><a href="#cli_tls_min_v1_0"><code>--tls-min-v1.0</code></a></li>
225<li><a href="#cli_tls_min_v1_1"><code>--tls-min-v1.1</code></a></li>
226<li><a href="#cli_tls_min_v1_2"><code>--tls-min-v1.2</code></a></li>
227<li><a href="#cli_tls_min_v1_3"><code>--tls-min-v1.3</code></a></li>
228<li><a href="#cli_trace_atomics_wait"><code>--trace-atomics-wait</code></a></li>
229<li><a href="#cli_trace_deprecation"><code>--trace-deprecation</code></a></li>
230<li><a href="#cli_trace_event_categories"><code>--trace-event-categories</code></a></li>
231<li><a href="#cli_trace_event_file_pattern"><code>--trace-event-file-pattern</code></a></li>
232<li><a href="#cli_trace_events_enabled"><code>--trace-events-enabled</code></a></li>
233<li><a href="#cli_trace_exit"><code>--trace-exit</code></a></li>
234<li><a href="#cli_trace_sigint"><code>--trace-sigint</code></a></li>
235<li><a href="#cli_trace_sync_io"><code>--trace-sync-io</code></a></li>
236<li><a href="#cli_trace_tls"><code>--trace-tls</code></a></li>
237<li><a href="#cli_trace_uncaught"><code>--trace-uncaught</code></a></li>
238<li><a href="#cli_trace_warnings"><code>--trace-warnings</code></a></li>
239<li><a href="#cli_track_heap_objects"><code>--track-heap-objects</code></a></li>
240<li><a href="#cli_unhandled_rejections_mode"><code>--unhandled-rejections=mode</code></a></li>
241<li><a href="#cli_use_bundled_ca_use_openssl_ca"><code>--use-bundled-ca</code>, <code>--use-openssl-ca</code></a></li>
242<li><a href="#cli_use_largepages_mode"><code>--use-largepages=mode</code></a></li>
243<li><a href="#cli_v8_options"><code>--v8-options</code></a></li>
244<li><a href="#cli_v8_pool_size_num"><code>--v8-pool-size=num</code></a></li>
245<li><a href="#cli_zero_fill_buffers"><code>--zero-fill-buffers</code></a></li>
246<li><a href="#cli_c_check"><code>-c</code>, <code>--check</code></a></li>
247<li><a href="#cli_e_eval_script"><code>-e</code>, <code>--eval "script"</code></a></li>
248<li><a href="#cli_h_help"><code>-h</code>, <code>--help</code></a></li>
249<li><a href="#cli_i_interactive"><code>-i</code>, <code>--interactive</code></a></li>
250<li><a href="#cli_p_print_script"><code>-p</code>, <code>--print "script"</code></a></li>
251<li><a href="#cli_r_require_module"><code>-r</code>, <code>--require module</code></a></li>
252<li><a href="#cli_v_version"><code>-v</code>, <code>--version</code></a></li>
253</ul>
254</li>
255<li><a href="#cli_environment_variables">Environment variables</a>
256<ul>
257<li><a href="#cli_force_color_1_2_3"><code>FORCE_COLOR=[1, 2, 3]</code></a></li>
258<li><a href="#cli_node_debug_module"><code>NODE_DEBUG=module[,…]</code></a></li>
259<li><a href="#cli_node_debug_native_module"><code>NODE_DEBUG_NATIVE=module[,…]</code></a></li>
260<li><a href="#cli_node_disable_colors_1"><code>NODE_DISABLE_COLORS=1</code></a></li>
261<li><a href="#cli_node_extra_ca_certs_file"><code>NODE_EXTRA_CA_CERTS=file</code></a></li>
262<li><a href="#cli_node_icu_data_file"><code>NODE_ICU_DATA=file</code></a></li>
263<li><a href="#cli_node_no_warnings_1"><code>NODE_NO_WARNINGS=1</code></a></li>
264<li><a href="#cli_node_options_options"><code>NODE_OPTIONS=options...</code></a></li>
265<li><a href="#cli_node_path_path"><code>NODE_PATH=path[:…]</code></a></li>
266<li><a href="#cli_node_pending_deprecation_1"><code>NODE_PENDING_DEPRECATION=1</code></a></li>
267<li><a href="#cli_node_pending_pipe_instances_instances"><code>NODE_PENDING_PIPE_INSTANCES=instances</code></a></li>
268<li><a href="#cli_node_preserve_symlinks_1"><code>NODE_PRESERVE_SYMLINKS=1</code></a></li>
269<li><a href="#cli_node_redirect_warnings_file"><code>NODE_REDIRECT_WARNINGS=file</code></a></li>
270<li><a href="#cli_node_repl_history_file"><code>NODE_REPL_HISTORY=file</code></a></li>
271<li><a href="#cli_node_repl_external_module_file"><code>NODE_REPL_EXTERNAL_MODULE=file</code></a></li>
272<li><a href="#cli_node_skip_platform_check_value"><code>NODE_SKIP_PLATFORM_CHECK=value</code></a></li>
273<li><a href="#cli_node_tls_reject_unauthorized_value"><code>NODE_TLS_REJECT_UNAUTHORIZED=value</code></a></li>
274<li><a href="#cli_node_v8_coverage_dir"><code>NODE_V8_COVERAGE=dir</code></a>
275<ul>
276<li><a href="#cli_coverage_output">Coverage output</a></li>
277<li><span class="stability_1"><a href="#cli_source_map_cache">Source map cache</a></span></li>
278</ul>
279</li>
280<li><a href="#cli_no_color_any"><code>NO_COLOR=&#x3C;any></code></a></li>
281<li><a href="#cli_openssl_conf_file"><code>OPENSSL_CONF=file</code></a></li>
282<li><a href="#cli_ssl_cert_dir_dir"><code>SSL_CERT_DIR=dir</code></a></li>
283<li><a href="#cli_ssl_cert_file_file"><code>SSL_CERT_FILE=file</code></a></li>
284<li><a href="#cli_uv_threadpool_size_size"><code>UV_THREADPOOL_SIZE=size</code></a></li>
285</ul>
286</li>
287<li><a href="#cli_useful_v8_options">Useful V8 options</a>
288<ul>
289<li><a href="#cli_max_old_space_size_size_in_megabytes"><code>--max-old-space-size=SIZE</code> (in megabytes)</a></li>
290</ul>
291</li>
292</ul>
293</li>
294</ul></details>
295
296      <div id="apicontent">
297        <h2>Command-line options<span><a class="mark" href="#cli_command_line_options" id="cli_command_line_options">#</a></span></h2>
298
299
300<p>Node.js comes with a variety of CLI options. These options expose built-in
301debugging, multiple ways to execute scripts, and other helpful runtime options.</p>
302<p>To view this documentation as a manual page in a terminal, run <code>man node</code>.</p>
303<section><h3>Synopsis<span><a class="mark" href="#cli_synopsis" id="cli_synopsis">#</a></span></h3>
304<p><code>node [options] [V8 options] [script.js | -e "script" | -] [--] [arguments]</code></p>
305<p><code>node inspect [script.js | -e "script" | &#x3C;host>:&#x3C;port>] …</code></p>
306<p><code>node --v8-options</code></p>
307<p>Execute without arguments to start the <a href="repl.html">REPL</a>.</p>
308<p>For more info about <code>node inspect</code>, see the <a href="debugger.html">debugger</a> documentation.</p>
309</section><section><h3>Options<span><a class="mark" href="#cli_options" id="cli_options">#</a></span></h3>
310<div class="api_metadata">
311<details class="changelog"><summary>History</summary>
312<table>
313<tbody><tr><th>Version</th><th>Changes</th></tr>
314<tr><td>v10.12.0</td>
315<td><p>Underscores instead of dashes are now allowed for Node.js options as well, in addition to V8 options.</p></td></tr>
316</tbody></table>
317</details>
318</div>
319<p>All options, including V8 options, allow words to be separated by both
320dashes (<code>-</code>) or underscores (<code>_</code>). For example, <code>--pending-deprecation</code> is
321equivalent to <code>--pending_deprecation</code>.</p>
322<p>If an option that takes a single value (such as <code>--max-http-header-size</code>) is
323passed more than once, then the last passed value is used. Options from the
324command line take precedence over options passed through the <a href="#cli_node_options_options"><code>NODE_OPTIONS</code></a>
325environment variable.</p>
326<h4><code>-</code><span><a class="mark" href="#cli" id="cli">#</a></span></h4>
327<div class="api_metadata">
328<span>Added in: v8.0.0</span>
329</div>
330<p>Alias for stdin. Analogous to the use of <code>-</code> in other command-line utilities,
331meaning that the script is read from stdin, and the rest of the options
332are passed to that script.</p>
333<h4><code>--</code><span><a class="mark" href="#cli_1" id="cli_1">#</a></span></h4>
334<div class="api_metadata">
335<span>Added in: v6.11.0</span>
336</div>
337<p>Indicate the end of node options. Pass the rest of the arguments to the script.
338If no script filename or eval/print script is supplied prior to this, then
339the next argument is used as a script filename.</p>
340<h4><code>--abort-on-uncaught-exception</code><span><a class="mark" href="#cli_abort_on_uncaught_exception" id="cli_abort_on_uncaught_exception">#</a></span></h4>
341<div class="api_metadata">
342<span>Added in: v0.10.8</span>
343</div>
344<p>Aborting instead of exiting causes a core file to be generated for post-mortem
345analysis using a debugger (such as <code>lldb</code>, <code>gdb</code>, and <code>mdb</code>).</p>
346<p>If this flag is passed, the behavior can still be set to not abort through
347<a href="process.html#process_process_setuncaughtexceptioncapturecallback_fn"><code>process.setUncaughtExceptionCaptureCallback()</code></a> (and through usage of the
348<code>domain</code> module that uses it).</p>
349<h4><code>--completion-bash</code><span><a class="mark" href="#cli_completion_bash" id="cli_completion_bash">#</a></span></h4>
350<div class="api_metadata">
351<span>Added in: v10.12.0</span>
352</div>
353<p>Print source-able bash completion script for Node.js.</p>
354<pre><code class="language-console"><span class="hljs-meta">$ </span><span class="language-bash">node --completion-bash > node_bash_completion</span>
355<span class="hljs-meta">$ </span><span class="language-bash"><span class="hljs-built_in">source</span> node_bash_completion</span></code></pre>
356<h4><code>-C=condition</code>, <code>--conditions=condition</code><span><a class="mark" href="#cli_c_condition_conditions_condition" id="cli_c_condition_conditions_condition">#</a></span></h4>
357<div class="api_metadata">
358<span>Added in: v14.9.0</span>
359</div>
360<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
361<p>Enable experimental support for custom <a href="packages.html#packages_conditional_exports">conditional exports</a> resolution
362conditions.</p>
363<p>Any number of custom string condition names are permitted.</p>
364<p>The default Node.js conditions of <code>"node"</code>, <code>"default"</code>, <code>"import"</code>, and
365<code>"require"</code> will always apply as defined.</p>
366<p>For example, to run a module with "development" resolutions:</p>
367<pre><code class="language-console"><span class="hljs-meta">$ </span><span class="language-bash">node -C=development app.js</span></code></pre>
368<h4><code>--cpu-prof</code><span><a class="mark" href="#cli_cpu_prof" id="cli_cpu_prof">#</a></span></h4>
369<div class="api_metadata">
370<span>Added in: v12.0.0</span>
371</div>
372<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
373<p>Starts the V8 CPU profiler on start up, and writes the CPU profile to disk
374before exit.</p>
375<p>If <code>--cpu-prof-dir</code> is not specified, the generated profile is placed
376in the current working directory.</p>
377<p>If <code>--cpu-prof-name</code> is not specified, the generated profile is
378named <code>CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile</code>.</p>
379<pre><code class="language-console"><span class="hljs-meta">$ </span><span class="language-bash">node --cpu-prof index.js</span>
380<span class="hljs-meta">$ </span><span class="language-bash">ls *.cpuprofile</span>
381CPU.20190409.202950.15293.0.0.cpuprofile</code></pre>
382<h4><code>--cpu-prof-dir</code><span><a class="mark" href="#cli_cpu_prof_dir" id="cli_cpu_prof_dir">#</a></span></h4>
383<div class="api_metadata">
384<span>Added in: v12.0.0</span>
385</div>
386<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
387<p>Specify the directory where the CPU profiles generated by <code>--cpu-prof</code> will
388be placed.</p>
389<p>The default value is controlled by the
390<a href="#cli_diagnostic_dir_directory">--diagnostic-dir</a> command-line option.</p>
391<h4><code>--cpu-prof-interval</code><span><a class="mark" href="#cli_cpu_prof_interval" id="cli_cpu_prof_interval">#</a></span></h4>
392<div class="api_metadata">
393<span>Added in: v12.2.0</span>
394</div>
395<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
396<p>Specify the sampling interval in microseconds for the CPU profiles generated
397by <code>--cpu-prof</code>. The default is 1000 microseconds.</p>
398<h4><code>--cpu-prof-name</code><span><a class="mark" href="#cli_cpu_prof_name" id="cli_cpu_prof_name">#</a></span></h4>
399<div class="api_metadata">
400<span>Added in: v12.0.0</span>
401</div>
402<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
403<p>Specify the file name of the CPU profile generated by <code>--cpu-prof</code>.</p>
404<h4><code>--diagnostic-dir=directory</code><span><a class="mark" href="#cli_diagnostic_dir_directory" id="cli_diagnostic_dir_directory">#</a></span></h4>
405<p>Set the directory to which all diagnostic output files are written.
406Defaults to current working directory.</p>
407<p>Affects the default output directory of:</p>
408<ul>
409<li><a href="#cli_cpu_prof_dir">--cpu-prof-dir</a></li>
410<li><a href="#cli_heap_prof_dir">--heap-prof-dir</a></li>
411<li><a href="#cli_redirect_warnings_file">--redirect-warnings</a></li>
412</ul>
413<h4><code>--disable-proto=mode</code><span><a class="mark" href="#cli_disable_proto_mode" id="cli_disable_proto_mode">#</a></span></h4>
414<div class="api_metadata">
415<span>Added in: v13.12.0</span>
416</div>
417<p>Disable the <code>Object.prototype.__proto__</code> property. If <code>mode</code> is <code>delete</code>, the
418property is removed entirely. If <code>mode</code> is <code>throw</code>, accesses to the
419property throw an exception with the code <code>ERR_PROTO_ACCESS</code>.</p>
420<h4><code>--disallow-code-generation-from-strings</code><span><a class="mark" href="#cli_disallow_code_generation_from_strings" id="cli_disallow_code_generation_from_strings">#</a></span></h4>
421<div class="api_metadata">
422<span>Added in: v9.8.0</span>
423</div>
424<p>Make built-in language features like <code>eval</code> and <code>new Function</code> that generate
425code from strings throw an exception instead. This does not affect the Node.js
426<code>vm</code> module.</p>
427<h4><code>--dns-result-order=order</code><span><a class="mark" href="#cli_dns_result_order_order" id="cli_dns_result_order_order">#</a></span></h4>
428<div class="api_metadata">
429<span>Added in: v14.18.0</span>
430</div>
431<p>Set the default value of <code>verbatim</code> in <a href="dns.html#dns_dns_lookup_hostname_options_callback"><code>dns.lookup()</code></a> and
432<a href="dns.html#dns_dnspromises_lookup_hostname_options"><code>dnsPromises.lookup()</code></a>. The value could be:</p>
433<ul>
434<li><code>ipv4first</code>: sets default <code>verbatim</code> <code>false</code>.</li>
435<li><code>verbatim</code>: sets default <code>verbatim</code> <code>true</code>.</li>
436</ul>
437<p>The default is <code>ipv4first</code> and <a href="dns.html#dns_dns_setdefaultresultorder_order"><code>dns.setDefaultResultOrder()</code></a> have higher
438priority than <code>--dns-result-order</code>.</p>
439<h4><code>--enable-fips</code><span><a class="mark" href="#cli_enable_fips" id="cli_enable_fips">#</a></span></h4>
440<div class="api_metadata">
441<span>Added in: v6.0.0</span>
442</div>
443<p>Enable FIPS-compliant crypto at startup. (Requires Node.js to be built
444against FIPS-compatible OpenSSL.)</p>
445<h4><code>--enable-source-maps</code><span><a class="mark" href="#cli_enable_source_maps" id="cli_enable_source_maps">#</a></span></h4>
446<div class="api_metadata">
447<details class="changelog"><summary>History</summary>
448<table>
449<tbody><tr><th>Version</th><th>Changes</th></tr>
450<tr><td>v14.18.0</td>
451<td><p>This API is no longer experimental.</p></td></tr>
452<tr><td>v12.12.0</td>
453<td><p><span>Added in: v12.12.0</span></p></td></tr>
454</tbody></table>
455</details>
456</div>
457<p>Enable <a href="https://sourcemaps.info/spec.html">Source Map v3</a> support for stack traces.</p>
458<p>When using a transpiler, such as TypeScript, strack traces thrown by an
459application reference the transpiled code, not the original source position.
460<code>--enable-source-maps</code> enables caching of Source Maps and makes a best
461effort to report stack traces relative to the original source file.</p>
462<p>Overriding <code>Error.prepareStackTrace</code> prevents <code>--enable-source-maps</code> from
463modifiying the stack trace.</p>
464<h4><code>--experimental-abortcontroller</code><span><a class="mark" href="#cli_experimental_abortcontroller" id="cli_experimental_abortcontroller">#</a></span></h4>
465<div class="api_metadata">
466<span>Added in: v14.17.0</span>
467</div>
468<p>Enable experimental <code>AbortController</code> and <code>AbortSignal</code> support.</p>
469<h4><code>--experimental-import-meta-resolve</code><span><a class="mark" href="#cli_experimental_import_meta_resolve" id="cli_experimental_import_meta_resolve">#</a></span></h4>
470<div class="api_metadata">
471<span>Added in: v13.9.0, v12.16.2</span>
472</div>
473<p>Enable experimental <code>import.meta.resolve()</code> support.</p>
474<h4><code>--experimental-json-modules</code><span><a class="mark" href="#cli_experimental_json_modules" id="cli_experimental_json_modules">#</a></span></h4>
475<div class="api_metadata">
476<span>Added in: v12.9.0</span>
477</div>
478<p>Enable experimental JSON support for the ES Module loader.</p>
479<h4><code>--experimental-loader=module</code><span><a class="mark" href="#cli_experimental_loader_module" id="cli_experimental_loader_module">#</a></span></h4>
480<div class="api_metadata">
481<span>Added in: v9.0.0</span>
482</div>
483<p>Specify the <code>module</code> of a custom experimental <a href="esm.html#esm_loaders">ECMAScript Module loader</a>.
484<code>module</code> may be either a path to a file, or an ECMAScript Module name.</p>
485<h4><code>--experimental-modules</code><span><a class="mark" href="#cli_experimental_modules" id="cli_experimental_modules">#</a></span></h4>
486<div class="api_metadata">
487<span>Added in: v8.5.0</span>
488</div>
489<p>Enable latest experimental modules features (deprecated).</p>
490<h4><code>--experimental-policy</code><span><a class="mark" href="#cli_experimental_policy" id="cli_experimental_policy">#</a></span></h4>
491<div class="api_metadata">
492<span>Added in: v11.8.0</span>
493</div>
494<p>Use the specified file as a security policy.</p>
495<h4><code>--experimental-repl-await</code><span><a class="mark" href="#cli_experimental_repl_await" id="cli_experimental_repl_await">#</a></span></h4>
496<div class="api_metadata">
497<span>Added in: v10.0.0</span>
498</div>
499<p>Enable experimental top-level <code>await</code> keyword support in REPL.</p>
500<h4><code>--experimental-specifier-resolution=mode</code><span><a class="mark" href="#cli_experimental_specifier_resolution_mode" id="cli_experimental_specifier_resolution_mode">#</a></span></h4>
501<div class="api_metadata">
502<span>Added in: v13.4.0, v12.16.0</span>
503</div>
504<p>Sets the resolution algorithm for resolving ES module specifiers. Valid options
505are <code>explicit</code> and <code>node</code>.</p>
506<p>The default is <code>explicit</code>, which requires providing the full path to a
507module. The <code>node</code> mode enables support for optional file extensions and
508the ability to import a directory that has an index file.</p>
509<p>See <a href="esm.html#esm_customizing_esm_specifier_resolution_algorithm">customizing ESM specifier resolution</a> for example usage.</p>
510<h4><code>--experimental-vm-modules</code><span><a class="mark" href="#cli_experimental_vm_modules" id="cli_experimental_vm_modules">#</a></span></h4>
511<div class="api_metadata">
512<span>Added in: v9.6.0</span>
513</div>
514<p>Enable experimental ES Module support in the <code>vm</code> module.</p>
515<h4><code>--experimental-wasi-unstable-preview1</code><span><a class="mark" href="#cli_experimental_wasi_unstable_preview1" id="cli_experimental_wasi_unstable_preview1">#</a></span></h4>
516<div class="api_metadata">
517<details class="changelog"><summary>History</summary>
518<table>
519<tbody><tr><th>Version</th><th>Changes</th></tr>
520<tr><td>v13.6.0</td>
521<td><p>changed from <code>--experimental-wasi-unstable-preview0</code> to <code>--experimental-wasi-unstable-preview1</code>.</p></td></tr>
522<tr><td>v13.3.0, v12.16.0</td>
523<td><p><span>Added in: v13.3.0, v12.16.0</span></p></td></tr>
524</tbody></table>
525</details>
526</div>
527<p>Enable experimental WebAssembly System Interface (WASI) support.</p>
528<h4><code>--experimental-wasm-modules</code><span><a class="mark" href="#cli_experimental_wasm_modules" id="cli_experimental_wasm_modules">#</a></span></h4>
529<div class="api_metadata">
530<span>Added in: v12.3.0</span>
531</div>
532<p>Enable experimental WebAssembly module support.</p>
533<h4><code>--force-context-aware</code><span><a class="mark" href="#cli_force_context_aware" id="cli_force_context_aware">#</a></span></h4>
534<div class="api_metadata">
535<span>Added in: v12.12.0</span>
536</div>
537<p>Disable loading native addons that are not <a href="addons.html#addons_context_aware_addons">context-aware</a>.</p>
538<h4><code>--force-fips</code><span><a class="mark" href="#cli_force_fips" id="cli_force_fips">#</a></span></h4>
539<div class="api_metadata">
540<span>Added in: v6.0.0</span>
541</div>
542<p>Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.)
543(Same requirements as <code>--enable-fips</code>.)</p>
544<h4><code>--frozen-intrinsics</code><span><a class="mark" href="#cli_frozen_intrinsics" id="cli_frozen_intrinsics">#</a></span></h4>
545<div class="api_metadata">
546<span>Added in: v11.12.0</span>
547</div>
548<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
549<p>Enable experimental frozen intrinsics like <code>Array</code> and <code>Object</code>.</p>
550<p>Support is currently only provided for the root context and no guarantees are
551currently provided that <code>global.Array</code> is indeed the default intrinsic
552reference. Code may break under this flag.</p>
553<p><code>--require</code> runs prior to freezing intrinsics in order to allow polyfills to
554be added.</p>
555<h4><code>--heapsnapshot-near-heap-limit=max_count</code><span><a class="mark" href="#cli_heapsnapshot_near_heap_limit_max_count" id="cli_heapsnapshot_near_heap_limit_max_count">#</a></span></h4>
556<div class="api_metadata">
557<span>Added in: v14.18.0</span>
558</div>
559<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
560<p>Writes a V8 heap snapshot to disk when the V8 heap usage is approaching the
561heap limit. <code>count</code> should be a non-negative integer (in which case
562Node.js will write no more than <code>max_count</code> snapshots to disk).</p>
563<p>When generating snapshots, garbage collection may be triggered and bring
564the heap usage down, therefore multiple snapshots may be written to disk
565before the Node.js instance finally runs out of memory. These heap snapshots
566can be compared to determine what objects are being allocated during the
567time consecutive snapshots are taken. It's not guaranteed that Node.js will
568write exactly <code>max_count</code> snapshots to disk, but it will try
569its best to generate at least one and up to <code>max_count</code> snapshots before the
570Node.js instance runs out of memory when <code>max_count</code> is greater than <code>0</code>.</p>
571<p>Generating V8 snapshots takes time and memory (both memory managed by the
572V8 heap and native memory outside the V8 heap). The bigger the heap is,
573the more resources it needs. Node.js will adjust the V8 heap to accommondate
574the additional V8 heap memory overhead, and try its best to avoid using up
575all the memory avialable to the process. When the process uses
576more memory than the system deems appropriate, the process may be terminated
577abruptly by the system, depending on the system configuration.</p>
578<pre><code class="language-console"><span class="hljs-meta">$ </span><span class="language-bash">node --max-old-space-size=100 --heapsnapshot-near-heap-limit=3 index.js</span>
579Wrote snapshot to Heap.20200430.100036.49580.0.001.heapsnapshot
580Wrote snapshot to Heap.20200430.100037.49580.0.002.heapsnapshot
581Wrote snapshot to Heap.20200430.100038.49580.0.003.heapsnapshot
582
583&#x3C;--- Last few GCs --->
584
585[49580:0x110000000]     4826 ms: Mark-sweep 130.6 (147.8) -> 130.5 (147.8) MB, 27.4 / 0.0 ms  (average mu = 0.126, current mu = 0.034) allocation failure scavenge might not succeed
586[49580:0x110000000]     4845 ms: Mark-sweep 130.6 (147.8) -> 130.6 (147.8) MB, 18.8 / 0.0 ms  (average mu = 0.088, current mu = 0.031) allocation failure scavenge might not succeed
587
588
589&#x3C;--- JS stacktrace --->
590
591FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
592....</code></pre>
593<h4><code>--heapsnapshot-signal=signal</code><span><a class="mark" href="#cli_heapsnapshot_signal_signal" id="cli_heapsnapshot_signal_signal">#</a></span></h4>
594<div class="api_metadata">
595<span>Added in: v12.0.0</span>
596</div>
597<p>Enables a signal handler that causes the Node.js process to write a heap dump
598when the specified signal is received. <code>signal</code> must be a valid signal name.
599Disabled by default.</p>
600<pre><code class="language-console"><span class="hljs-meta">$ </span><span class="language-bash">node --heapsnapshot-signal=SIGUSR2 index.js &#x26;</span>
601<span class="hljs-meta">$ </span><span class="language-bash">ps aux</span>
602USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
603node         1  5.5  6.1 787252 247004 ?       Ssl  16:43   0:02 node --heapsnapshot-signal=SIGUSR2 index.js
604<span class="hljs-meta">$ </span><span class="language-bash"><span class="hljs-built_in">kill</span> -USR2 1</span>
605<span class="hljs-meta">$ </span><span class="language-bash">ls</span>
606Heap.20190718.133405.15554.0.001.heapsnapshot</code></pre>
607<h4><code>--heap-prof</code><span><a class="mark" href="#cli_heap_prof" id="cli_heap_prof">#</a></span></h4>
608<div class="api_metadata">
609<span>Added in: v12.4.0</span>
610</div>
611<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
612<p>Starts the V8 heap profiler on start up, and writes the heap profile to disk
613before exit.</p>
614<p>If <code>--heap-prof-dir</code> is not specified, the generated profile is placed
615in the current working directory.</p>
616<p>If <code>--heap-prof-name</code> is not specified, the generated profile is
617named <code>Heap.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.heapprofile</code>.</p>
618<pre><code class="language-console"><span class="hljs-meta">$ </span><span class="language-bash">node --heap-prof index.js</span>
619<span class="hljs-meta">$ </span><span class="language-bash">ls *.heapprofile</span>
620Heap.20190409.202950.15293.0.001.heapprofile</code></pre>
621<h4><code>--heap-prof-dir</code><span><a class="mark" href="#cli_heap_prof_dir" id="cli_heap_prof_dir">#</a></span></h4>
622<div class="api_metadata">
623<span>Added in: v12.4.0</span>
624</div>
625<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
626<p>Specify the directory where the heap profiles generated by <code>--heap-prof</code> will
627be placed.</p>
628<p>The default value is controlled by the
629<a href="#cli_diagnostic_dir_directory">--diagnostic-dir</a> command-line option.</p>
630<h4><code>--heap-prof-interval</code><span><a class="mark" href="#cli_heap_prof_interval" id="cli_heap_prof_interval">#</a></span></h4>
631<div class="api_metadata">
632<span>Added in: v12.4.0</span>
633</div>
634<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
635<p>Specify the average sampling interval in bytes for the heap profiles generated
636by <code>--heap-prof</code>. The default is 512 * 1024 bytes.</p>
637<h4><code>--heap-prof-name</code><span><a class="mark" href="#cli_heap_prof_name" id="cli_heap_prof_name">#</a></span></h4>
638<div class="api_metadata">
639<span>Added in: v12.4.0</span>
640</div>
641<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
642<p>Specify the file name of the heap profile generated by <code>--heap-prof</code>.</p>
643<h4><code>--icu-data-dir=file</code><span><a class="mark" href="#cli_icu_data_dir_file" id="cli_icu_data_dir_file">#</a></span></h4>
644<div class="api_metadata">
645<span>Added in: v0.11.15</span>
646</div>
647<p>Specify ICU data load path. (Overrides <code>NODE_ICU_DATA</code>.)</p>
648<h4><code>--input-type=type</code><span><a class="mark" href="#cli_input_type_type" id="cli_input_type_type">#</a></span></h4>
649<div class="api_metadata">
650<span>Added in: v12.0.0</span>
651</div>
652<p>This configures Node.js to interpret string input as CommonJS or as an ES
653module. String input is input via <code>--eval</code>, <code>--print</code>, or <code>STDIN</code>.</p>
654<p>Valid values are <code>"commonjs"</code> and <code>"module"</code>. The default is <code>"commonjs"</code>.</p>
655<h4><code>--inspect-brk[=[host:]port]</code><span><a class="mark" href="#cli_inspect_brk_host_port" id="cli_inspect_brk_host_port">#</a></span></h4>
656<div class="api_metadata">
657<span>Added in: v7.6.0</span>
658</div>
659<p>Activate inspector on <code>host:port</code> and break at start of user script.
660Default <code>host:port</code> is <code>127.0.0.1:9229</code>.</p>
661<h4><code>--inspect-port=[host:]port</code><span><a class="mark" href="#cli_inspect_port_host_port" id="cli_inspect_port_host_port">#</a></span></h4>
662<div class="api_metadata">
663<span>Added in: v7.6.0</span>
664</div>
665<p>Set the <code>host:port</code> to be used when the inspector is activated.
666Useful when activating the inspector by sending the <code>SIGUSR1</code> signal.</p>
667<p>Default host is <code>127.0.0.1</code>.</p>
668<p>See the <a href="#inspector_security">security warning</a> below regarding the <code>host</code>
669parameter usage.</p>
670<h4><code>--inspect[=[host:]port]</code><span><a class="mark" href="#cli_inspect_host_port" id="cli_inspect_host_port">#</a></span></h4>
671<div class="api_metadata">
672<span>Added in: v6.3.0</span>
673</div>
674<p>Activate inspector on <code>host:port</code>. Default is <code>127.0.0.1:9229</code>.</p>
675<p>V8 inspector integration allows tools such as Chrome DevTools and IDEs to debug
676and profile Node.js instances. The tools attach to Node.js instances via a
677tcp port and communicate using the <a href="https://chromedevtools.github.io/devtools-protocol/">Chrome DevTools Protocol</a>.</p>
678<p><a id="inspector_security"></a></p>
679<h5>Warning: binding inspector to a public IP:port combination is insecure<span><a class="mark" href="#cli_warning_binding_inspector_to_a_public_ip_port_combination_is_insecure" id="cli_warning_binding_inspector_to_a_public_ip_port_combination_is_insecure">#</a></span></h5>
680<p>Binding the inspector to a public IP (including <code>0.0.0.0</code>) with an open port is
681insecure, as it allows external hosts to connect to the inspector and perform
682a <a href="https://www.owasp.org/index.php/Code_Injection">remote code execution</a> attack.</p>
683<p>If specifying a host, make sure that either:</p>
684<ul>
685<li>The host is not accessible from public networks.</li>
686<li>A firewall disallows unwanted connections on the port.</li>
687</ul>
688<p><strong>More specifically, <code>--inspect=0.0.0.0</code> is insecure if the port (<code>9229</code> by
689default) is not firewall-protected.</strong></p>
690<p>See the <a href="https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications">debugging security implications</a> section for more information.</p>
691<h4><code>--inspect-publish-uid=stderr,http</code><span><a class="mark" href="#cli_inspect_publish_uid_stderr_http" id="cli_inspect_publish_uid_stderr_http">#</a></span></h4>
692<p>Specify ways of the inspector web socket url exposure.</p>
693<p>By default inspector websocket url is available in stderr and under <code>/json/list</code>
694endpoint on <code>http://host:port/json/list</code>.</p>
695<h4><code>--insecure-http-parser</code><span><a class="mark" href="#cli_insecure_http_parser" id="cli_insecure_http_parser">#</a></span></h4>
696<div class="api_metadata">
697<span>Added in: v13.4.0, v12.15.0, v10.19.0</span>
698</div>
699<p>Use an insecure HTTP parser that accepts invalid HTTP headers. This may allow
700interoperability with non-conformant HTTP implementations. It may also allow
701request smuggling and other HTTP attacks that rely on invalid headers being
702accepted. Avoid using this option.</p>
703<h4><code>--jitless</code><span><a class="mark" href="#cli_jitless" id="cli_jitless">#</a></span></h4>
704<div class="api_metadata">
705<span>Added in: v12.0.0</span>
706</div>
707<p>Disable <a href="https://v8.dev/blog/jitless">runtime allocation of executable memory</a>. This may be
708required on some platforms for security reasons. It can also reduce attack
709surface on other platforms, but the performance impact may be severe.</p>
710<p>This flag is inherited from V8 and is subject to change upstream. It may
711disappear in a non-semver-major release.</p>
712<h4><code>--max-http-header-size=size</code><span><a class="mark" href="#cli_max_http_header_size_size" id="cli_max_http_header_size_size">#</a></span></h4>
713<div class="api_metadata">
714<details class="changelog"><summary>History</summary>
715<table>
716<tbody><tr><th>Version</th><th>Changes</th></tr>
717<tr><td>v14.0.0</td>
718<td><p>Change maximum default size of HTTP headers from 8KB to 16KB.</p></td></tr>
719<tr><td>v11.6.0, v10.15.0</td>
720<td><p><span>Added in: v11.6.0, v10.15.0</span></p></td></tr>
721</tbody></table>
722</details>
723</div>
724<p>Specify the maximum size, in bytes, of HTTP headers. Defaults to 16KB.</p>
725<h4><code>--napi-modules</code><span><a class="mark" href="#cli_napi_modules" id="cli_napi_modules">#</a></span></h4>
726<div class="api_metadata">
727<span>Added in: v7.10.0</span>
728</div>
729<p>This option is a no-op. It is kept for compatibility.</p>
730<h4><code>--no-addons</code><span><a class="mark" href="#cli_no_addons" id="cli_no_addons">#</a></span></h4>
731<div class="api_metadata">
732<span>Added in: v14.19.0</span>
733</div>
734<p>Disable the <code>node-addons</code> exports condition as well as disable loading
735native addons. When <code>--no-addons</code> is specified, calling <code>process.dlopen</code> or
736requiring a native C++ addon will fail and throw an exception.</p>
737<h4><code>--no-deprecation</code><span><a class="mark" href="#cli_no_deprecation" id="cli_no_deprecation">#</a></span></h4>
738<div class="api_metadata">
739<span>Added in: v0.8.0</span>
740</div>
741<p>Silence deprecation warnings.</p>
742<h4><code>--no-force-async-hooks-checks</code><span><a class="mark" href="#cli_no_force_async_hooks_checks" id="cli_no_force_async_hooks_checks">#</a></span></h4>
743<div class="api_metadata">
744<span>Added in: v9.0.0</span>
745</div>
746<p>Disables runtime checks for <code>async_hooks</code>. These will still be enabled
747dynamically when <code>async_hooks</code> is enabled.</p>
748<h4><code>--no-warnings</code><span><a class="mark" href="#cli_no_warnings" id="cli_no_warnings">#</a></span></h4>
749<div class="api_metadata">
750<span>Added in: v6.0.0</span>
751</div>
752<p>Silence all process warnings (including deprecations).</p>
753<h4><code>--node-memory-debug</code><span><a class="mark" href="#cli_node_memory_debug" id="cli_node_memory_debug">#</a></span></h4>
754<div class="api_metadata">
755<span>Added in: v14.18.0</span>
756</div>
757<p>Enable extra debug checks for memory leaks in Node.js internals. This is
758usually only useful for developers debugging Node.js itself.</p>
759<h4><code>--openssl-config=file</code><span><a class="mark" href="#cli_openssl_config_file" id="cli_openssl_config_file">#</a></span></h4>
760<div class="api_metadata">
761<span>Added in: v6.9.0</span>
762</div>
763<p>Load an OpenSSL configuration file on startup. Among other uses, this can be
764used to enable FIPS-compliant crypto if Node.js is built
765against FIPS-enabled OpenSSL.</p>
766<h4><code>--openssl-shared-config</code><span><a class="mark" href="#cli_openssl_shared_config" id="cli_openssl_shared_config">#</a></span></h4>
767<div class="api_metadata">
768<span>Added in: v14.21.0</span>
769</div>
770<p>Enable OpenSSL default configuration section, <code>openssl_conf</code> to be read from
771the OpenSSL configuration file. The default configuration file is named
772<code>openssl.cnf</code> but this can be changed using the environment variable
773<code>OPENSSL_CONF</code>, or by using the command line option <code>--openssl-config</code>.
774The location of the default OpenSSL configuration file depends on how OpenSSL
775is being linked to Node.js. Sharing the OpenSSL configuration may have unwanted
776implications and it is recommended to use a configuration section specific to
777Node.js which is <code>nodejs_conf</code> and is default when this option is not used.</p>
778<h4><code>--pending-deprecation</code><span><a class="mark" href="#cli_pending_deprecation" id="cli_pending_deprecation">#</a></span></h4>
779<div class="api_metadata">
780<span>Added in: v8.0.0</span>
781</div>
782<p>Emit pending deprecation warnings.</p>
783<p>Pending deprecations are generally identical to a runtime deprecation with the
784notable exception that they are turned <em>off</em> by default and will not be emitted
785unless either the <code>--pending-deprecation</code> command-line flag, or the
786<code>NODE_PENDING_DEPRECATION=1</code> environment variable, is set. Pending deprecations
787are used to provide a kind of selective "early warning" mechanism that
788developers may leverage to detect deprecated API usage.</p>
789<h4><code>--policy-integrity=sri</code><span><a class="mark" href="#cli_policy_integrity_sri" id="cli_policy_integrity_sri">#</a></span></h4>
790<div class="api_metadata">
791<span>Added in: v12.7.0</span>
792</div>
793<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
794<p>Instructs Node.js to error prior to running any code if the policy does not have
795the specified integrity. It expects a <a href="https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity">Subresource Integrity</a> string as a
796parameter.</p>
797<h4><code>--preserve-symlinks</code><span><a class="mark" href="#cli_preserve_symlinks" id="cli_preserve_symlinks">#</a></span></h4>
798<div class="api_metadata">
799<span>Added in: v6.3.0</span>
800</div>
801<p>Instructs the module loader to preserve symbolic links when resolving and
802caching modules.</p>
803<p>By default, when Node.js loads a module from a path that is symbolically linked
804to a different on-disk location, Node.js will dereference the link and use the
805actual on-disk "real path" of the module as both an identifier and as a root
806path to locate other dependency modules. In most cases, this default behavior
807is acceptable. However, when using symbolically linked peer dependencies, as
808illustrated in the example below, the default behavior causes an exception to
809be thrown if <code>moduleA</code> attempts to require <code>moduleB</code> as a peer dependency:</p>
810<pre><code class="language-text">{appDir}
811 ├── app
812 │   ├── index.js
813 │   └── node_modules
814 │       ├── moduleA -> {appDir}/moduleA
815 │       └── moduleB
816 │           ├── index.js
817 │           └── package.json
818 └── moduleA
819     ├── index.js
820     └── package.json</code></pre>
821<p>The <code>--preserve-symlinks</code> command-line flag instructs Node.js to use the
822symlink path for modules as opposed to the real path, allowing symbolically
823linked peer dependencies to be found.</p>
824<p>Note, however, that using <code>--preserve-symlinks</code> can have other side effects.
825Specifically, symbolically linked <em>native</em> modules can fail to load if those
826are linked from more than one location in the dependency tree (Node.js would
827see those as two separate modules and would attempt to load the module multiple
828times, causing an exception to be thrown).</p>
829<p>The <code>--preserve-symlinks</code> flag does not apply to the main module, which allows
830<code>node --preserve-symlinks node_module/.bin/&#x3C;foo></code> to work. To apply the same
831behavior for the main module, also use <code>--preserve-symlinks-main</code>.</p>
832<h4><code>--preserve-symlinks-main</code><span><a class="mark" href="#cli_preserve_symlinks_main" id="cli_preserve_symlinks_main">#</a></span></h4>
833<div class="api_metadata">
834<span>Added in: v10.2.0</span>
835</div>
836<p>Instructs the module loader to preserve symbolic links when resolving and
837caching the main module (<code>require.main</code>).</p>
838<p>This flag exists so that the main module can be opted-in to the same behavior
839that <code>--preserve-symlinks</code> gives to all other imports; they are separate flags,
840however, for backward compatibility with older Node.js versions.</p>
841<p><code>--preserve-symlinks-main</code> does not imply <code>--preserve-symlinks</code>; use
842<code>--preserve-symlinks-main</code> in addition to
843<code>--preserve-symlinks</code> when it is not desirable to follow symlinks before
844resolving relative paths.</p>
845<p>See <code>--preserve-symlinks</code> for more information.</p>
846<h4><code>--prof</code><span><a class="mark" href="#cli_prof" id="cli_prof">#</a></span></h4>
847<div class="api_metadata">
848<span>Added in: v2.0.0</span>
849</div>
850<p>Generate V8 profiler output.</p>
851<h4><code>--prof-process</code><span><a class="mark" href="#cli_prof_process" id="cli_prof_process">#</a></span></h4>
852<div class="api_metadata">
853<span>Added in: v5.2.0</span>
854</div>
855<p>Process V8 profiler output generated using the V8 option <code>--prof</code>.</p>
856<h4><code>--redirect-warnings=file</code><span><a class="mark" href="#cli_redirect_warnings_file" id="cli_redirect_warnings_file">#</a></span></h4>
857<div class="api_metadata">
858<span>Added in: v8.0.0</span>
859</div>
860<p>Write process warnings to the given file instead of printing to stderr. The
861file will be created if it does not exist, and will be appended to if it does.
862If an error occurs while attempting to write the warning to the file, the
863warning will be written to stderr instead.</p>
864<p>The <code>file</code> name may be an absolute path. If it is not, the default directory it
865will be written to is controlled by the
866<a href="#cli_diagnostic_dir_directory">--diagnostic-dir</a> command-line option.</p>
867<h4><code>--report-compact</code><span><a class="mark" href="#cli_report_compact" id="cli_report_compact">#</a></span></h4>
868<div class="api_metadata">
869<span>Added in: v13.12.0</span>
870</div>
871<p>Write reports in a compact format, single-line JSON, more easily consumable
872by log processing systems than the default multi-line format designed for
873human consumption.</p>
874<h4><code>--report-dir=directory</code>, <code>report-directory=directory</code><span><a class="mark" href="#cli_report_dir_directory_report_directory_directory" id="cli_report_dir_directory_report_directory_directory">#</a></span></h4>
875<div class="api_metadata">
876<details class="changelog"><summary>History</summary>
877<table>
878<tbody><tr><th>Version</th><th>Changes</th></tr>
879<tr><td>v13.12.0</td>
880<td><p>This option is no longer experimental.</p></td></tr>
881<tr><td>v12.0.0</td>
882<td><p>Changed from <code>--diagnostic-report-directory</code> to <code>--report-directory</code>.</p></td></tr>
883<tr><td>v11.8.0</td>
884<td><p><span>Added in: v11.8.0</span></p></td></tr>
885</tbody></table>
886</details>
887</div>
888<p>Location at which the report will be generated.</p>
889<h4><code>--report-filename=filename</code><span><a class="mark" href="#cli_report_filename_filename" id="cli_report_filename_filename">#</a></span></h4>
890<div class="api_metadata">
891<details class="changelog"><summary>History</summary>
892<table>
893<tbody><tr><th>Version</th><th>Changes</th></tr>
894<tr><td>v13.12.0</td>
895<td><p>This option is no longer experimental.</p></td></tr>
896<tr><td>v12.0.0</td>
897<td><p>changed from <code>--diagnostic-report-filename</code> to <code>--report-filename</code>.</p></td></tr>
898<tr><td>v11.8.0</td>
899<td><p><span>Added in: v11.8.0</span></p></td></tr>
900</tbody></table>
901</details>
902</div>
903<p>Name of the file to which the report will be written.</p>
904<h4><code>--report-on-fatalerror</code><span><a class="mark" href="#cli_report_on_fatalerror" id="cli_report_on_fatalerror">#</a></span></h4>
905<div class="api_metadata">
906<details class="changelog"><summary>History</summary>
907<table>
908<tbody><tr><th>Version</th><th>Changes</th></tr>
909<tr><td>v14.0.0</td>
910<td><p>This option is no longer experimental.</p></td></tr>
911<tr><td>v12.0.0</td>
912<td><p>changed from <code>--diagnostic-report-on-fatalerror</code> to <code>--report-on-fatalerror</code>.</p></td></tr>
913<tr><td>v11.8.0</td>
914<td><p><span>Added in: v11.8.0</span></p></td></tr>
915</tbody></table>
916</details>
917</div>
918<p>Enables the report to be triggered on fatal errors (internal errors within
919the Node.js runtime such as out of memory) that lead to termination of the
920application. Useful to inspect various diagnostic data elements such as heap,
921stack, event loop state, resource consumption etc. to reason about the fatal
922error.</p>
923<h4><code>--report-on-signal</code><span><a class="mark" href="#cli_report_on_signal" id="cli_report_on_signal">#</a></span></h4>
924<div class="api_metadata">
925<details class="changelog"><summary>History</summary>
926<table>
927<tbody><tr><th>Version</th><th>Changes</th></tr>
928<tr><td>v13.12.0</td>
929<td><p>This option is no longer experimental.</p></td></tr>
930<tr><td>v12.0.0</td>
931<td><p>changed from <code>--diagnostic-report-on-signal</code> to <code>--report-on-signal</code>.</p></td></tr>
932<tr><td>v11.8.0</td>
933<td><p><span>Added in: v11.8.0</span></p></td></tr>
934</tbody></table>
935</details>
936</div>
937<p>Enables report to be generated upon receiving the specified (or predefined)
938signal to the running Node.js process. The signal to trigger the report is
939specified through <code>--report-signal</code>.</p>
940<h4><code>--report-signal=signal</code><span><a class="mark" href="#cli_report_signal_signal" id="cli_report_signal_signal">#</a></span></h4>
941<div class="api_metadata">
942<details class="changelog"><summary>History</summary>
943<table>
944<tbody><tr><th>Version</th><th>Changes</th></tr>
945<tr><td>v13.12.0</td>
946<td><p>This option is no longer experimental.</p></td></tr>
947<tr><td>v12.0.0</td>
948<td><p>changed from <code>--diagnostic-report-signal</code> to <code>--report-signal</code>.</p></td></tr>
949<tr><td>v11.8.0</td>
950<td><p><span>Added in: v11.8.0</span></p></td></tr>
951</tbody></table>
952</details>
953</div>
954<p>Sets or resets the signal for report generation (not supported on Windows).
955Default signal is <code>SIGUSR2</code>.</p>
956<h4><code>--report-uncaught-exception</code><span><a class="mark" href="#cli_report_uncaught_exception" id="cli_report_uncaught_exception">#</a></span></h4>
957<div class="api_metadata">
958<details class="changelog"><summary>History</summary>
959<table>
960<tbody><tr><th>Version</th><th>Changes</th></tr>
961<tr><td>v13.12.0</td>
962<td><p>This option is no longer experimental.</p></td></tr>
963<tr><td>v12.0.0</td>
964<td><p>changed from <code>--diagnostic-report-uncaught-exception</code> to <code>--report-uncaught-exception</code>.</p></td></tr>
965<tr><td>v11.8.0</td>
966<td><p><span>Added in: v11.8.0</span></p></td></tr>
967</tbody></table>
968</details>
969</div>
970<p>Enables report to be generated on uncaught exceptions. Useful when inspecting
971the JavaScript stack in conjunction with native stack and other runtime
972environment data.</p>
973<h4><code>--throw-deprecation</code><span><a class="mark" href="#cli_throw_deprecation" id="cli_throw_deprecation">#</a></span></h4>
974<div class="api_metadata">
975<span>Added in: v0.11.14</span>
976</div>
977<p>Throw errors for deprecations.</p>
978<h4><code>--title=title</code><span><a class="mark" href="#cli_title_title" id="cli_title_title">#</a></span></h4>
979<div class="api_metadata">
980<span>Added in: v10.7.0</span>
981</div>
982<p>Set <code>process.title</code> on startup.</p>
983<h4><code>--tls-cipher-list=list</code><span><a class="mark" href="#cli_tls_cipher_list_list" id="cli_tls_cipher_list_list">#</a></span></h4>
984<div class="api_metadata">
985<span>Added in: v4.0.0</span>
986</div>
987<p>Specify an alternative default TLS cipher list. Requires Node.js to be built
988with crypto support (default).</p>
989<h4><code>--tls-keylog=file</code><span><a class="mark" href="#cli_tls_keylog_file" id="cli_tls_keylog_file">#</a></span></h4>
990<div class="api_metadata">
991<span>Added in: v13.2.0, v12.16.0</span>
992</div>
993<p>Log TLS key material to a file. The key material is in NSS <code>SSLKEYLOGFILE</code>
994format and can be used by software (such as Wireshark) to decrypt the TLS
995traffic.</p>
996<h4><code>--tls-max-v1.2</code><span><a class="mark" href="#cli_tls_max_v1_2" id="cli_tls_max_v1_2">#</a></span></h4>
997<div class="api_metadata">
998<span>Added in: v12.0.0, v10.20.0</span>
999</div>
1000<p>Set <a href="tls.html#tls_tls_default_max_version"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1.2'. Use to disable support for
1001TLSv1.3.</p>
1002<h4><code>--tls-max-v1.3</code><span><a class="mark" href="#cli_tls_max_v1_3" id="cli_tls_max_v1_3">#</a></span></h4>
1003<div class="api_metadata">
1004<span>Added in: v12.0.0</span>
1005</div>
1006<p>Set default <a href="tls.html#tls_tls_default_max_version"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1.3'. Use to enable support
1007for TLSv1.3.</p>
1008<h4><code>--tls-min-v1.0</code><span><a class="mark" href="#cli_tls_min_v1_0" id="cli_tls_min_v1_0">#</a></span></h4>
1009<div class="api_metadata">
1010<span>Added in: v12.0.0, v10.20.0</span>
1011</div>
1012<p>Set default <a href="tls.html#tls_tls_default_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1'. Use for compatibility with
1013old TLS clients or servers.</p>
1014<h4><code>--tls-min-v1.1</code><span><a class="mark" href="#cli_tls_min_v1_1" id="cli_tls_min_v1_1">#</a></span></h4>
1015<div class="api_metadata">
1016<span>Added in: v12.0.0, v10.20.0</span>
1017</div>
1018<p>Set default <a href="tls.html#tls_tls_default_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.1'. Use for compatibility
1019with old TLS clients or servers.</p>
1020<h4><code>--tls-min-v1.2</code><span><a class="mark" href="#cli_tls_min_v1_2" id="cli_tls_min_v1_2">#</a></span></h4>
1021<div class="api_metadata">
1022<span>Added in: v12.2.0, v10.20.0</span>
1023</div>
1024<p>Set default <a href="tls.html#tls_tls_default_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.2'. This is the default for
102512.x and later, but the option is supported for compatibility with older Node.js
1026versions.</p>
1027<h4><code>--tls-min-v1.3</code><span><a class="mark" href="#cli_tls_min_v1_3" id="cli_tls_min_v1_3">#</a></span></h4>
1028<div class="api_metadata">
1029<span>Added in: v12.0.0</span>
1030</div>
1031<p>Set default <a href="tls.html#tls_tls_default_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.3'. Use to disable support
1032for TLSv1.2, which is not as secure as TLSv1.3.</p>
1033<h4><code>--trace-atomics-wait</code><span><a class="mark" href="#cli_trace_atomics_wait" id="cli_trace_atomics_wait">#</a></span></h4>
1034<div class="api_metadata">
1035<span>Added in: v14.3.0</span>
1036</div>
1037<p>Print short summaries of calls to <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/wait"><code>Atomics.wait()</code></a> to stderr.
1038The output could look like this:</p>
1039<pre><code class="language-text">(node:15701) [Thread 0] Atomics.wait(&#x26;lt;address> + 0, 1, inf) started
1040(node:15701) [Thread 0] Atomics.wait(&#x26;lt;address> + 0, 1, inf) did not wait because the values mismatched
1041(node:15701) [Thread 0] Atomics.wait(&#x26;lt;address> + 0, 0, 10) started
1042(node:15701) [Thread 0] Atomics.wait(&#x26;lt;address> + 0, 0, 10) timed out
1043(node:15701) [Thread 0] Atomics.wait(&#x26;lt;address> + 4, 0, inf) started
1044(node:15701) [Thread 1] Atomics.wait(&#x26;lt;address> + 4, -1, inf) started
1045(node:15701) [Thread 0] Atomics.wait(&#x26;lt;address> + 4, 0, inf) was woken up by another thread
1046(node:15701) [Thread 1] Atomics.wait(&#x26;lt;address> + 4, -1, inf) was woken up by another thread</code></pre>
1047<p>The fields here correspond to:</p>
1048<ul>
1049<li>The thread id as given by <a href="worker_threads.html#worker_threads_worker_threadid"><code>worker_threads.threadId</code></a></li>
1050<li>The base address of the <code>SharedArrayBuffer</code> in question, as well as the
1051byte offset corresponding to the index passed to <code>Atomics.wait()</code></li>
1052<li>The expected value that was passed to <code>Atomics.wait()</code></li>
1053<li>The timeout passed to <code>Atomics.wait</code></li>
1054</ul>
1055<h4><code>--trace-deprecation</code><span><a class="mark" href="#cli_trace_deprecation" id="cli_trace_deprecation">#</a></span></h4>
1056<div class="api_metadata">
1057<span>Added in: v0.8.0</span>
1058</div>
1059<p>Print stack traces for deprecations.</p>
1060<h4><code>--trace-event-categories</code><span><a class="mark" href="#cli_trace_event_categories" id="cli_trace_event_categories">#</a></span></h4>
1061<div class="api_metadata">
1062<span>Added in: v7.7.0</span>
1063</div>
1064<p>A comma separated list of categories that should be traced when trace event
1065tracing is enabled using <code>--trace-events-enabled</code>.</p>
1066<h4><code>--trace-event-file-pattern</code><span><a class="mark" href="#cli_trace_event_file_pattern" id="cli_trace_event_file_pattern">#</a></span></h4>
1067<div class="api_metadata">
1068<span>Added in: v9.8.0</span>
1069</div>
1070<p>Template string specifying the filepath for the trace event data, it
1071supports <code>${rotation}</code> and <code>${pid}</code>.</p>
1072<h4><code>--trace-events-enabled</code><span><a class="mark" href="#cli_trace_events_enabled" id="cli_trace_events_enabled">#</a></span></h4>
1073<div class="api_metadata">
1074<span>Added in: v7.7.0</span>
1075</div>
1076<p>Enables the collection of trace event tracing information.</p>
1077<h4><code>--trace-exit</code><span><a class="mark" href="#cli_trace_exit" id="cli_trace_exit">#</a></span></h4>
1078<div class="api_metadata">
1079<span>Added in: v13.5.0, v12.16.0</span>
1080</div>
1081<p>Prints a stack trace whenever an environment is exited proactively,
1082i.e. invoking <code>process.exit()</code>.</p>
1083<h4><code>--trace-sigint</code><span><a class="mark" href="#cli_trace_sigint" id="cli_trace_sigint">#</a></span></h4>
1084<div class="api_metadata">
1085<span>Added in: v13.9.0</span>
1086</div>
1087<p>Prints a stack trace on SIGINT.</p>
1088<h4><code>--trace-sync-io</code><span><a class="mark" href="#cli_trace_sync_io" id="cli_trace_sync_io">#</a></span></h4>
1089<div class="api_metadata">
1090<span>Added in: v2.1.0</span>
1091</div>
1092<p>Prints a stack trace whenever synchronous I/O is detected after the first turn
1093of the event loop.</p>
1094<h4><code>--trace-tls</code><span><a class="mark" href="#cli_trace_tls" id="cli_trace_tls">#</a></span></h4>
1095<div class="api_metadata">
1096<span>Added in: v12.2.0</span>
1097</div>
1098<p>Prints TLS packet trace information to <code>stderr</code>. This can be used to debug TLS
1099connection problems.</p>
1100<h4><code>--trace-uncaught</code><span><a class="mark" href="#cli_trace_uncaught" id="cli_trace_uncaught">#</a></span></h4>
1101<div class="api_metadata">
1102<span>Added in: v13.1.0</span>
1103</div>
1104<p>Print stack traces for uncaught exceptions; usually, the stack trace associated
1105with the creation of an <code>Error</code> is printed, whereas this makes Node.js also
1106print the stack trace associated with throwing the value (which does not need
1107to be an <code>Error</code> instance).</p>
1108<p>Enabling this option may affect garbage collection behavior negatively.</p>
1109<h4><code>--trace-warnings</code><span><a class="mark" href="#cli_trace_warnings" id="cli_trace_warnings">#</a></span></h4>
1110<div class="api_metadata">
1111<span>Added in: v6.0.0</span>
1112</div>
1113<p>Print stack traces for process warnings (including deprecations).</p>
1114<h4><code>--track-heap-objects</code><span><a class="mark" href="#cli_track_heap_objects" id="cli_track_heap_objects">#</a></span></h4>
1115<div class="api_metadata">
1116<span>Added in: v2.4.0</span>
1117</div>
1118<p>Track heap object allocations for heap snapshots.</p>
1119<h4><code>--unhandled-rejections=mode</code><span><a class="mark" href="#cli_unhandled_rejections_mode" id="cli_unhandled_rejections_mode">#</a></span></h4>
1120<div class="api_metadata">
1121<span>Added in: v12.0.0, v10.17.0</span>
1122</div>
1123<p>By default all unhandled rejections trigger a warning plus a deprecation warning
1124for the very first unhandled rejection in case no <a href="process.html#process_event_unhandledrejection"><code>unhandledRejection</code></a> hook
1125is used.</p>
1126<p>Using this flag allows to change what should happen when an unhandled rejection
1127occurs. One of the following modes can be chosen:</p>
1128<ul>
1129<li><code>throw</code>: Emit <a href="process.html#process_event_unhandledrejection"><code>unhandledRejection</code></a>. If this hook is not set, raise the
1130unhandled rejection as an uncaught exception.</li>
1131<li><code>strict</code>: Raise the unhandled rejection as an uncaught exception.</li>
1132<li><code>warn</code>: Always trigger a warning, no matter if the <a href="process.html#process_event_unhandledrejection"><code>unhandledRejection</code></a>
1133hook is set or not but do not print the deprecation warning.</li>
1134<li><code>warn-with-error-code</code>: Emit <a href="process.html#process_event_unhandledrejection"><code>unhandledRejection</code></a>. If this hook is not
1135set, trigger a warning, and set the process exit code to 1.</li>
1136<li><code>none</code>: Silence all warnings.</li>
1137</ul>
1138<h4><code>--use-bundled-ca</code>, <code>--use-openssl-ca</code><span><a class="mark" href="#cli_use_bundled_ca_use_openssl_ca" id="cli_use_bundled_ca_use_openssl_ca">#</a></span></h4>
1139<div class="api_metadata">
1140<span>Added in: v6.11.0</span>
1141</div>
1142<p>Use bundled Mozilla CA store as supplied by current Node.js version
1143or use OpenSSL's default CA store. The default store is selectable
1144at build-time.</p>
1145<p>The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store
1146that is fixed at release time. It is identical on all supported platforms.</p>
1147<p>Using OpenSSL store allows for external modifications of the store. For most
1148Linux and BSD distributions, this store is maintained by the distribution
1149maintainers and system administrators. OpenSSL CA store location is dependent on
1150configuration of the OpenSSL library but this can be altered at runtime using
1151environment variables.</p>
1152<p>See <code>SSL_CERT_DIR</code> and <code>SSL_CERT_FILE</code>.</p>
1153<h4><code>--use-largepages=mode</code><span><a class="mark" href="#cli_use_largepages_mode" id="cli_use_largepages_mode">#</a></span></h4>
1154<div class="api_metadata">
1155<span>Added in: v13.6.0</span>
1156</div>
1157<p>Re-map the Node.js static code to large memory pages at startup. If supported on
1158the target system, this will cause the Node.js static code to be moved onto 2
1159MiB pages instead of 4 KiB pages.</p>
1160<p>The following values are valid for <code>mode</code>:</p>
1161<ul>
1162<li><code>off</code>: No mapping will be attempted. This is the default.</li>
1163<li><code>on</code>: If supported by the OS, mapping will be attempted. Failure to map will
1164be ignored and a message will be printed to standard error.</li>
1165<li><code>silent</code>: If supported by the OS, mapping will be attempted. Failure to map
1166will be ignored and will not be reported.</li>
1167</ul>
1168<h4><code>--v8-options</code><span><a class="mark" href="#cli_v8_options" id="cli_v8_options">#</a></span></h4>
1169<div class="api_metadata">
1170<span>Added in: v0.1.3</span>
1171</div>
1172<p>Print V8 command-line options.</p>
1173<h4><code>--v8-pool-size=num</code><span><a class="mark" href="#cli_v8_pool_size_num" id="cli_v8_pool_size_num">#</a></span></h4>
1174<div class="api_metadata">
1175<span>Added in: v5.10.0</span>
1176</div>
1177<p>Set V8's thread pool size which will be used to allocate background jobs.</p>
1178<p>If set to <code>0</code> then V8 will choose an appropriate size of the thread pool based
1179on the number of online processors.</p>
1180<p>If the value provided is larger than V8's maximum, then the largest value
1181will be chosen.</p>
1182<h4><code>--zero-fill-buffers</code><span><a class="mark" href="#cli_zero_fill_buffers" id="cli_zero_fill_buffers">#</a></span></h4>
1183<div class="api_metadata">
1184<span>Added in: v6.0.0</span>
1185</div>
1186<p>Automatically zero-fills all newly allocated <a href="buffer.html#buffer_class_buffer"><code>Buffer</code></a> and <a href="buffer.html#buffer_class_slowbuffer"><code>SlowBuffer</code></a>
1187instances.</p>
1188<h4><code>-c</code>, <code>--check</code><span><a class="mark" href="#cli_c_check" id="cli_c_check">#</a></span></h4>
1189<div class="api_metadata">
1190<details class="changelog"><summary>History</summary>
1191<table>
1192<tbody><tr><th>Version</th><th>Changes</th></tr>
1193<tr><td>v10.0.0</td>
1194<td><p>The <code>--require</code> option is now supported when checking a file.</p></td></tr>
1195<tr><td>v5.0.0, v4.2.0</td>
1196<td><p><span>Added in: v5.0.0, v4.2.0</span></p></td></tr>
1197</tbody></table>
1198</details>
1199</div>
1200<p>Syntax check the script without executing.</p>
1201<h4><code>-e</code>, <code>--eval "script"</code><span><a class="mark" href="#cli_e_eval_script" id="cli_e_eval_script">#</a></span></h4>
1202<div class="api_metadata">
1203<details class="changelog"><summary>History</summary>
1204<table>
1205<tbody><tr><th>Version</th><th>Changes</th></tr>
1206<tr><td>v5.11.0</td>
1207<td><p>Built-in libraries are now available as predefined variables.</p></td></tr>
1208<tr><td>v0.5.2</td>
1209<td><p><span>Added in: v0.5.2</span></p></td></tr>
1210</tbody></table>
1211</details>
1212</div>
1213<p>Evaluate the following argument as JavaScript. The modules which are
1214predefined in the REPL can also be used in <code>script</code>.</p>
1215<p>On Windows, using <code>cmd.exe</code> a single quote will not work correctly because it
1216only recognizes double <code>"</code> for quoting. In Powershell or Git bash, both <code>'</code>
1217and <code>"</code> are usable.</p>
1218<h4><code>-h</code>, <code>--help</code><span><a class="mark" href="#cli_h_help" id="cli_h_help">#</a></span></h4>
1219<div class="api_metadata">
1220<span>Added in: v0.1.3</span>
1221</div>
1222<p>Print node command-line options.
1223The output of this option is less detailed than this document.</p>
1224<h4><code>-i</code>, <code>--interactive</code><span><a class="mark" href="#cli_i_interactive" id="cli_i_interactive">#</a></span></h4>
1225<div class="api_metadata">
1226<span>Added in: v0.7.7</span>
1227</div>
1228<p>Opens the REPL even if stdin does not appear to be a terminal.</p>
1229<h4><code>-p</code>, <code>--print "script"</code><span><a class="mark" href="#cli_p_print_script" id="cli_p_print_script">#</a></span></h4>
1230<div class="api_metadata">
1231<details class="changelog"><summary>History</summary>
1232<table>
1233<tbody><tr><th>Version</th><th>Changes</th></tr>
1234<tr><td>v5.11.0</td>
1235<td><p>Built-in libraries are now available as predefined variables.</p></td></tr>
1236<tr><td>v0.6.4</td>
1237<td><p><span>Added in: v0.6.4</span></p></td></tr>
1238</tbody></table>
1239</details>
1240</div>
1241<p>Identical to <code>-e</code> but prints the result.</p>
1242<h4><code>-r</code>, <code>--require module</code><span><a class="mark" href="#cli_r_require_module" id="cli_r_require_module">#</a></span></h4>
1243<div class="api_metadata">
1244<span>Added in: v1.6.0</span>
1245</div>
1246<p>Preload the specified module at startup.</p>
1247<p>Follows <code>require()</code>'s module resolution
1248rules. <code>module</code> may be either a path to a file, or a node module name.</p>
1249<p>Only CommonJS modules are supported. Attempting to preload a
1250ES6 Module using <code>--require</code> will fail with an error.</p>
1251<h4><code>-v</code>, <code>--version</code><span><a class="mark" href="#cli_v_version" id="cli_v_version">#</a></span></h4>
1252<div class="api_metadata">
1253<span>Added in: v0.1.3</span>
1254</div>
1255<p>Print node's version.</p>
1256</section><section><h3>Environment variables<span><a class="mark" href="#cli_environment_variables" id="cli_environment_variables">#</a></span></h3>
1257<h4><code>FORCE_COLOR=[1, 2, 3]</code><span><a class="mark" href="#cli_force_color_1_2_3" id="cli_force_color_1_2_3">#</a></span></h4>
1258<p>The <code>FORCE_COLOR</code> environment variable is used to
1259enable ANSI colorized output. The value may be:</p>
1260<ul>
1261<li><code>1</code>, <code>true</code>, or the empty string <code>''</code> indicate 16-color support,</li>
1262<li><code>2</code> to indicate 256-color support, or</li>
1263<li><code>3</code> to indicate 16 million-color support.</li>
1264</ul>
1265<p>When <code>FORCE_COLOR</code> is used and set to a supported value, both the <code>NO_COLOR</code>,
1266and <code>NODE_DISABLE_COLORS</code> environment variables are ignored.</p>
1267<p>Any other value will result in colorized output being disabled.</p>
1268<h4><code>NODE_DEBUG=module[,…]</code><span><a class="mark" href="#cli_node_debug_module" id="cli_node_debug_module">#</a></span></h4>
1269<div class="api_metadata">
1270<span>Added in: v0.1.32</span>
1271</div>
1272<p><code>','</code>-separated list of core modules that should print debug information.</p>
1273<h4><code>NODE_DEBUG_NATIVE=module[,…]</code><span><a class="mark" href="#cli_node_debug_native_module" id="cli_node_debug_native_module">#</a></span></h4>
1274<p><code>','</code>-separated list of core C++ modules that should print debug information.</p>
1275<h4><code>NODE_DISABLE_COLORS=1</code><span><a class="mark" href="#cli_node_disable_colors_1" id="cli_node_disable_colors_1">#</a></span></h4>
1276<div class="api_metadata">
1277<span>Added in: v0.3.0</span>
1278</div>
1279<p>When set, colors will not be used in the REPL.</p>
1280<h4><code>NODE_EXTRA_CA_CERTS=file</code><span><a class="mark" href="#cli_node_extra_ca_certs_file" id="cli_node_extra_ca_certs_file">#</a></span></h4>
1281<div class="api_metadata">
1282<span>Added in: v7.3.0</span>
1283</div>
1284<p>When set, the well known "root" CAs (like VeriSign) will be extended with the
1285extra certificates in <code>file</code>. The file should consist of one or more trusted
1286certificates in PEM format. A message will be emitted (once) with
1287<a href="process.html#process_process_emitwarning_warning_type_code_ctor"><code>process.emitWarning()</code></a> if the file is missing or
1288malformed, but any errors are otherwise ignored.</p>
1289<p>Neither the well known nor extra certificates are used when the <code>ca</code>
1290options property is explicitly specified for a TLS or HTTPS client or server.</p>
1291<p>This environment variable is ignored when <code>node</code> runs as setuid root or
1292has Linux file capabilities set.</p>
1293<p>The <code>NODE_EXTRA_CA_CERTS</code> environment variable is only read when the Node.js
1294process is first launched. Changing the value at runtime using
1295<code>process.env.NODE_EXTRA_CA_CERTS</code> has no effect on the current process.</p>
1296<h4><code>NODE_ICU_DATA=file</code><span><a class="mark" href="#cli_node_icu_data_file" id="cli_node_icu_data_file">#</a></span></h4>
1297<div class="api_metadata">
1298<span>Added in: v0.11.15</span>
1299</div>
1300<p>Data path for ICU (<code>Intl</code> object) data. Will extend linked-in data when compiled
1301with small-icu support.</p>
1302<h4><code>NODE_NO_WARNINGS=1</code><span><a class="mark" href="#cli_node_no_warnings_1" id="cli_node_no_warnings_1">#</a></span></h4>
1303<div class="api_metadata">
1304<span>Added in: v6.11.0</span>
1305</div>
1306<p>When set to <code>1</code>, process warnings are silenced.</p>
1307<h4><code>NODE_OPTIONS=options...</code><span><a class="mark" href="#cli_node_options_options" id="cli_node_options_options">#</a></span></h4>
1308<div class="api_metadata">
1309<span>Added in: v8.0.0</span>
1310</div>
1311<p>A space-separated list of command-line options. <code>options...</code> are interpreted
1312before command-line options, so command-line options will override or
1313compound after anything in <code>options...</code>. Node.js will exit with an error if
1314an option that is not allowed in the environment is used, such as <code>-p</code> or a
1315script file.</p>
1316<p>If an option value contains a space, it can be escaped using double quotes:</p>
1317<pre><code class="language-bash">NODE_OPTIONS=<span class="hljs-string">'--require "./my path/file.js"'</span></code></pre>
1318<p>A singleton flag passed as a command-line option will override the same flag
1319passed into <code>NODE_OPTIONS</code>:</p>
1320<pre><code class="language-bash"><span class="hljs-comment"># The inspector will be available on port 5555</span>
1321NODE_OPTIONS=<span class="hljs-string">'--inspect=localhost:4444'</span> node --inspect=localhost:5555</code></pre>
1322<p>A flag that can be passed multiple times will be treated as if its
1323<code>NODE_OPTIONS</code> instances were passed first, and then its command-line
1324instances afterwards:</p>
1325<pre><code class="language-bash">NODE_OPTIONS=<span class="hljs-string">'--require "./a.js"'</span> node --require <span class="hljs-string">"./b.js"</span>
1326<span class="hljs-comment"># is equivalent to:</span>
1327node --require <span class="hljs-string">"./a.js"</span> --require <span class="hljs-string">"./b.js"</span></code></pre>
1328<p>Node.js options that are allowed are:</p>
1329<!-- node-options-node start -->
1330<ul>
1331<li><code>--conditions</code>, <code>-C</code></li>
1332<li><code>--diagnostic-dir</code></li>
1333<li><code>--disable-proto</code></li>
1334<li><code>--dns-result-order</code></li>
1335<li><code>--enable-fips</code></li>
1336<li><code>--enable-source-maps</code></li>
1337<li><code>--experimental-abortcontroller</code></li>
1338<li><code>--experimental-import-meta-resolve</code></li>
1339<li><code>--experimental-json-modules</code></li>
1340<li><code>--experimental-loader</code></li>
1341<li><code>--experimental-modules</code></li>
1342<li><code>--experimental-policy</code></li>
1343<li><code>--experimental-repl-await</code></li>
1344<li><code>--experimental-specifier-resolution</code></li>
1345<li><code>--experimental-top-level-await</code></li>
1346<li><code>--experimental-vm-modules</code></li>
1347<li><code>--experimental-wasi-unstable-preview1</code></li>
1348<li><code>--experimental-wasm-modules</code></li>
1349<li><code>--force-context-aware</code></li>
1350<li><code>--force-fips</code></li>
1351<li><code>--frozen-intrinsics</code></li>
1352<li><code>--heapsnapshot-near-heap-limit</code></li>
1353<li><code>--heapsnapshot-signal</code></li>
1354<li><code>--http-parser</code></li>
1355<li><code>--icu-data-dir</code></li>
1356<li><code>--input-type</code></li>
1357<li><code>--insecure-http-parser</code></li>
1358<li><code>--inspect-brk</code></li>
1359<li><code>--inspect-port</code>, <code>--debug-port</code></li>
1360<li><code>--inspect-publish-uid</code></li>
1361<li><code>--inspect</code></li>
1362<li><code>--max-http-header-size</code></li>
1363<li><code>--napi-modules</code></li>
1364<li><code>--no-addons</code></li>
1365<li><code>--no-deprecation</code></li>
1366<li><code>--no-force-async-hooks-checks</code></li>
1367<li><code>--no-warnings</code></li>
1368<li><code>--node-memory-debug</code></li>
1369<li><code>--openssl-config</code></li>
1370<li><code>--openssl-shared-config</code></li>
1371<li><code>--pending-deprecation</code></li>
1372<li><code>--policy-integrity</code></li>
1373<li><code>--preserve-symlinks-main</code></li>
1374<li><code>--preserve-symlinks</code></li>
1375<li><code>--prof-process</code></li>
1376<li><code>--redirect-warnings</code></li>
1377<li><code>--report-compact</code></li>
1378<li><code>--report-dir</code>, <code>--report-directory</code></li>
1379<li><code>--report-filename</code></li>
1380<li><code>--report-on-fatalerror</code></li>
1381<li><code>--report-on-signal</code></li>
1382<li><code>--report-signal</code></li>
1383<li><code>--report-uncaught-exception</code></li>
1384<li><code>--require</code>, <code>-r</code></li>
1385<li><code>--throw-deprecation</code></li>
1386<li><code>--title</code></li>
1387<li><code>--tls-cipher-list</code></li>
1388<li><code>--tls-keylog</code></li>
1389<li><code>--tls-max-v1.2</code></li>
1390<li><code>--tls-max-v1.3</code></li>
1391<li><code>--tls-min-v1.0</code></li>
1392<li><code>--tls-min-v1.1</code></li>
1393<li><code>--tls-min-v1.2</code></li>
1394<li><code>--tls-min-v1.3</code></li>
1395<li><code>--trace-atomics-wait</code></li>
1396<li><code>--trace-deprecation</code></li>
1397<li><code>--trace-event-categories</code></li>
1398<li><code>--trace-event-file-pattern</code></li>
1399<li><code>--trace-events-enabled</code></li>
1400<li><code>--trace-exit</code></li>
1401<li><code>--trace-sigint</code></li>
1402<li><code>--trace-sync-io</code></li>
1403<li><code>--trace-tls</code></li>
1404<li><code>--trace-uncaught</code></li>
1405<li><code>--trace-warnings</code></li>
1406<li><code>--track-heap-objects</code></li>
1407<li><code>--unhandled-rejections</code></li>
1408<li><code>--use-bundled-ca</code></li>
1409<li><code>--use-largepages</code></li>
1410<li><code>--use-openssl-ca</code></li>
1411<li><code>--v8-pool-size</code></li>
1412<li><code>--zero-fill-buffers</code></li>
1413</ul>
1414<!-- node-options-node end -->
1415<p>V8 options that are allowed are:</p>
1416<!-- node-options-v8 start -->
1417<ul>
1418<li><code>--abort-on-uncaught-exception</code></li>
1419<li><code>--disallow-code-generation-from-strings</code></li>
1420<li><code>--huge-max-old-generation-size</code></li>
1421<li><code>--interpreted-frames-native-stack</code></li>
1422<li><code>--jitless</code></li>
1423<li><code>--max-old-space-size</code></li>
1424<li><code>--perf-basic-prof-only-functions</code></li>
1425<li><code>--perf-basic-prof</code></li>
1426<li><code>--perf-prof-unwinding-info</code></li>
1427<li><code>--perf-prof</code></li>
1428<li><code>--stack-trace-limit</code></li>
1429</ul>
1430<!-- node-options-v8 end -->
1431<p><code>--perf-basic-prof-only-functions</code>, <code>--perf-basic-prof</code>,
1432<code>--perf-prof-unwinding-info</code>, and <code>--perf-prof</code> are only available on Linux.</p>
1433<h4><code>NODE_PATH=path[:…]</code><span><a class="mark" href="#cli_node_path_path" id="cli_node_path_path">#</a></span></h4>
1434<div class="api_metadata">
1435<span>Added in: v0.1.32</span>
1436</div>
1437<p><code>':'</code>-separated list of directories prefixed to the module search path.</p>
1438<p>On Windows, this is a <code>';'</code>-separated list instead.</p>
1439<h4><code>NODE_PENDING_DEPRECATION=1</code><span><a class="mark" href="#cli_node_pending_deprecation_1" id="cli_node_pending_deprecation_1">#</a></span></h4>
1440<div class="api_metadata">
1441<span>Added in: v8.0.0</span>
1442</div>
1443<p>When set to <code>1</code>, emit pending deprecation warnings.</p>
1444<p>Pending deprecations are generally identical to a runtime deprecation with the
1445notable exception that they are turned <em>off</em> by default and will not be emitted
1446unless either the <code>--pending-deprecation</code> command-line flag, or the
1447<code>NODE_PENDING_DEPRECATION=1</code> environment variable, is set. Pending deprecations
1448are used to provide a kind of selective "early warning" mechanism that
1449developers may leverage to detect deprecated API usage.</p>
1450<h4><code>NODE_PENDING_PIPE_INSTANCES=instances</code><span><a class="mark" href="#cli_node_pending_pipe_instances_instances" id="cli_node_pending_pipe_instances_instances">#</a></span></h4>
1451<p>Set the number of pending pipe instance handles when the pipe server is waiting
1452for connections. This setting applies to Windows only.</p>
1453<h4><code>NODE_PRESERVE_SYMLINKS=1</code><span><a class="mark" href="#cli_node_preserve_symlinks_1" id="cli_node_preserve_symlinks_1">#</a></span></h4>
1454<div class="api_metadata">
1455<span>Added in: v7.1.0</span>
1456</div>
1457<p>When set to <code>1</code>, instructs the module loader to preserve symbolic links when
1458resolving and caching modules.</p>
1459<h4><code>NODE_REDIRECT_WARNINGS=file</code><span><a class="mark" href="#cli_node_redirect_warnings_file" id="cli_node_redirect_warnings_file">#</a></span></h4>
1460<div class="api_metadata">
1461<span>Added in: v8.0.0</span>
1462</div>
1463<p>When set, process warnings will be emitted to the given file instead of
1464printing to stderr. The file will be created if it does not exist, and will be
1465appended to if it does. If an error occurs while attempting to write the
1466warning to the file, the warning will be written to stderr instead. This is
1467equivalent to using the <code>--redirect-warnings=file</code> command-line flag.</p>
1468<h4><code>NODE_REPL_HISTORY=file</code><span><a class="mark" href="#cli_node_repl_history_file" id="cli_node_repl_history_file">#</a></span></h4>
1469<div class="api_metadata">
1470<span>Added in: v3.0.0</span>
1471</div>
1472<p>Path to the file used to store the persistent REPL history. The default path is
1473<code>~/.node_repl_history</code>, which is overridden by this variable. Setting the value
1474to an empty string (<code>''</code> or <code>' '</code>) disables persistent REPL history.</p>
1475<h4><code>NODE_REPL_EXTERNAL_MODULE=file</code><span><a class="mark" href="#cli_node_repl_external_module_file" id="cli_node_repl_external_module_file">#</a></span></h4>
1476<div class="api_metadata">
1477<span>Added in: v13.0.0, v12.16.0</span>
1478</div>
1479<p>Path to a Node.js module which will be loaded in place of the built-in REPL.
1480Overriding this value to an empty string (<code>''</code>) will use the built-in REPL.</p>
1481<h4><code>NODE_SKIP_PLATFORM_CHECK=value</code><span><a class="mark" href="#cli_node_skip_platform_check_value" id="cli_node_skip_platform_check_value">#</a></span></h4>
1482<div class="api_metadata">
1483<span>Added in: v14.5.0</span>
1484</div>
1485<p>If <code>value</code> equals <code>'1'</code>, the check for a supported platform is skipped during
1486Node.js startup. Node.js might not execute correctly. Any issues encountered
1487on unsupported platforms will not be fixed.</p>
1488<h4><code>NODE_TLS_REJECT_UNAUTHORIZED=value</code><span><a class="mark" href="#cli_node_tls_reject_unauthorized_value" id="cli_node_tls_reject_unauthorized_value">#</a></span></h4>
1489<p>If <code>value</code> equals <code>'0'</code>, certificate validation is disabled for TLS connections.
1490This makes TLS, and HTTPS by extension, insecure. The use of this environment
1491variable is strongly discouraged.</p>
1492<h4><code>NODE_V8_COVERAGE=dir</code><span><a class="mark" href="#cli_node_v8_coverage_dir" id="cli_node_v8_coverage_dir">#</a></span></h4>
1493<p>When set, Node.js will begin outputting <a href="https://v8project.blogspot.com/2017/12/javascript-code-coverage.html">V8 JavaScript code coverage</a> and
1494<a href="https://sourcemaps.info/spec.html">Source Map</a> data to the directory provided as an argument (coverage
1495information is written as JSON to files with a <code>coverage</code> prefix).</p>
1496<p><code>NODE_V8_COVERAGE</code> will automatically propagate to subprocesses, making it
1497easier to instrument applications that call the <code>child_process.spawn()</code> family
1498of functions. <code>NODE_V8_COVERAGE</code> can be set to an empty string, to prevent
1499propagation.</p>
1500<h5>Coverage output<span><a class="mark" href="#cli_coverage_output" id="cli_coverage_output">#</a></span></h5>
1501<p>Coverage is output as an array of <a href="https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage">ScriptCoverage</a> objects on the top-level
1502key <code>result</code>:</p>
1503<pre><code class="language-json"><span class="hljs-punctuation">{</span>
1504  <span class="hljs-attr">"result"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
1505    <span class="hljs-punctuation">{</span>
1506      <span class="hljs-attr">"scriptId"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"67"</span><span class="hljs-punctuation">,</span>
1507      <span class="hljs-attr">"url"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"internal/tty.js"</span><span class="hljs-punctuation">,</span>
1508      <span class="hljs-attr">"functions"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span>
1509    <span class="hljs-punctuation">}</span>
1510  <span class="hljs-punctuation">]</span>
1511<span class="hljs-punctuation">}</span></code></pre>
1512<h5>Source map cache<span><a class="mark" href="#cli_source_map_cache" id="cli_source_map_cache">#</a></span></h5>
1513<p></p><div class="api_stability api_stability_1"><a href="documentation.html#documentation_stability_index">Stability: 1</a> - Experimental</div><p></p>
1514<p>If found, source map data is appended to the top-level key <code>source-map-cache</code>
1515on the JSON coverage object.</p>
1516<p><code>source-map-cache</code> is an object with keys representing the files source maps
1517were extracted from, and values which include the raw source-map URL
1518(in the key <code>url</code>), the parsed Source Map v3 information (in the key <code>data</code>),
1519and the line lengths of the source file (in the key <code>lineLengths</code>).</p>
1520<pre><code class="language-json"><span class="hljs-punctuation">{</span>
1521  <span class="hljs-attr">"result"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
1522    <span class="hljs-punctuation">{</span>
1523      <span class="hljs-attr">"scriptId"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"68"</span><span class="hljs-punctuation">,</span>
1524      <span class="hljs-attr">"url"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"file:///absolute/path/to/source.js"</span><span class="hljs-punctuation">,</span>
1525      <span class="hljs-attr">"functions"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span>
1526    <span class="hljs-punctuation">}</span>
1527  <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
1528  <span class="hljs-attr">"source-map-cache"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
1529    <span class="hljs-attr">"file:///absolute/path/to/source.js"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
1530      <span class="hljs-attr">"url"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"./path-to-map.json"</span><span class="hljs-punctuation">,</span>
1531      <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
1532        <span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">3</span><span class="hljs-punctuation">,</span>
1533        <span class="hljs-attr">"sources"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
1534          <span class="hljs-string">"file:///absolute/path/to/original.js"</span>
1535        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
1536        <span class="hljs-attr">"names"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
1537          <span class="hljs-string">"Foo"</span><span class="hljs-punctuation">,</span>
1538          <span class="hljs-string">"console"</span><span class="hljs-punctuation">,</span>
1539          <span class="hljs-string">"info"</span>
1540        <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span>
1541        <span class="hljs-attr">"mappings"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"MAAMA,IACJC,YAAaC"</span><span class="hljs-punctuation">,</span>
1542        <span class="hljs-attr">"sourceRoot"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"./"</span>
1543      <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span>
1544      <span class="hljs-attr">"lineLengths"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
1545        <span class="hljs-number">13</span><span class="hljs-punctuation">,</span>
1546        <span class="hljs-number">62</span><span class="hljs-punctuation">,</span>
1547        <span class="hljs-number">38</span><span class="hljs-punctuation">,</span>
1548        <span class="hljs-number">27</span>
1549      <span class="hljs-punctuation">]</span>
1550    <span class="hljs-punctuation">}</span>
1551  <span class="hljs-punctuation">}</span>
1552<span class="hljs-punctuation">}</span></code></pre>
1553<h4><code>NO_COLOR=&#x3C;any></code><span><a class="mark" href="#cli_no_color_any" id="cli_no_color_any">#</a></span></h4>
1554<p><a href="https://no-color.org"><code>NO_COLOR</code></a>  is an alias for <code>NODE_DISABLE_COLORS</code>. The value of the
1555environment variable is arbitrary.</p>
1556<h4><code>OPENSSL_CONF=file</code><span><a class="mark" href="#cli_openssl_conf_file" id="cli_openssl_conf_file">#</a></span></h4>
1557<div class="api_metadata">
1558<span>Added in: v6.11.0</span>
1559</div>
1560<p>Load an OpenSSL configuration file on startup. Among other uses, this can be
1561used to enable FIPS-compliant crypto if Node.js is built with <code>./configure --openssl-fips</code>.</p>
1562<p>If the <a href="#cli_openssl_config_file"><code>--openssl-config</code></a> command-line option is used, the environment
1563variable is ignored.</p>
1564<h4><code>SSL_CERT_DIR=dir</code><span><a class="mark" href="#cli_ssl_cert_dir_dir" id="cli_ssl_cert_dir_dir">#</a></span></h4>
1565<div class="api_metadata">
1566<span>Added in: v7.7.0</span>
1567</div>
1568<p>If <code>--use-openssl-ca</code> is enabled, this overrides and sets OpenSSL's directory
1569containing trusted certificates.</p>
1570<p>Be aware that unless the child environment is explicitly set, this environment
1571variable will be inherited by any child processes, and if they use OpenSSL, it
1572may cause them to trust the same CAs as node.</p>
1573<h4><code>SSL_CERT_FILE=file</code><span><a class="mark" href="#cli_ssl_cert_file_file" id="cli_ssl_cert_file_file">#</a></span></h4>
1574<div class="api_metadata">
1575<span>Added in: v7.7.0</span>
1576</div>
1577<p>If <code>--use-openssl-ca</code> is enabled, this overrides and sets OpenSSL's file
1578containing trusted certificates.</p>
1579<p>Be aware that unless the child environment is explicitly set, this environment
1580variable will be inherited by any child processes, and if they use OpenSSL, it
1581may cause them to trust the same CAs as node.</p>
1582<h4><code>UV_THREADPOOL_SIZE=size</code><span><a class="mark" href="#cli_uv_threadpool_size_size" id="cli_uv_threadpool_size_size">#</a></span></h4>
1583<p>Set the number of threads used in libuv's threadpool to <code>size</code> threads.</p>
1584<p>Asynchronous system APIs are used by Node.js whenever possible, but where they
1585do not exist, libuv's threadpool is used to create asynchronous node APIs based
1586on synchronous system APIs. Node.js APIs that use the threadpool are:</p>
1587<ul>
1588<li>all <code>fs</code> APIs, other than the file watcher APIs and those that are explicitly
1589synchronous</li>
1590<li>asynchronous crypto APIs such as <code>crypto.pbkdf2()</code>, <code>crypto.scrypt()</code>,
1591<code>crypto.randomBytes()</code>, <code>crypto.randomFill()</code>, <code>crypto.generateKeyPair()</code></li>
1592<li><code>dns.lookup()</code></li>
1593<li>all <code>zlib</code> APIs, other than those that are explicitly synchronous</li>
1594</ul>
1595<p>Because libuv's threadpool has a fixed size, it means that if for whatever
1596reason any of these APIs takes a long time, other (seemingly unrelated) APIs
1597that run in libuv's threadpool will experience degraded performance. In order to
1598mitigate this issue, one potential solution is to increase the size of libuv's
1599threadpool by setting the <code>'UV_THREADPOOL_SIZE'</code> environment variable to a value
1600greater than <code>4</code> (its current default value). For more information, see the
1601<a href="https://docs.libuv.org/en/latest/threadpool.html">libuv threadpool documentation</a>.</p>
1602</section><section><h3>Useful V8 options<span><a class="mark" href="#cli_useful_v8_options" id="cli_useful_v8_options">#</a></span></h3>
1603<p>V8 has its own set of CLI options. Any V8 CLI option that is provided to <code>node</code>
1604will be passed on to V8 to handle. V8's options have <em>no stability guarantee</em>.
1605The V8 team themselves don't consider them to be part of their formal API,
1606and reserve the right to change them at any time. Likewise, they are not
1607covered by the Node.js stability guarantees. Many of the V8
1608options are of interest only to V8 developers. Despite this, there is a small
1609set of V8 options that are widely applicable to Node.js, and they are
1610documented here:</p>
1611<h4><code>--max-old-space-size=SIZE</code> (in megabytes)<span><a class="mark" href="#cli_max_old_space_size_size_in_megabytes" id="cli_max_old_space_size_size_in_megabytes">#</a></span></h4>
1612<p>Sets the max memory size of V8's old memory section. As memory
1613consumption approaches the limit, V8 will spend more time on
1614garbage collection in an effort to free unused memory.</p>
1615<p>On a machine with 2GB of memory, consider setting this to
16161536 (1.5GB) to leave some memory for other uses and avoid swapping.</p>
1617<pre><code class="language-console"><span class="hljs-meta">$ </span><span class="language-bash">node --max-old-space-size=1536 index.js</span></code></pre></section>
1618        <!-- API END -->
1619      </div>
1620    </div>
1621  </div>
1622  <script>
1623    'use strict';
1624    {
1625      const kCustomPreference = 'customDarkTheme';
1626      const userSettings = sessionStorage.getItem(kCustomPreference);
1627      const themeToggleButton = document.getElementById('theme-toggle-btn');
1628      if (userSettings === null && window.matchMedia) {
1629        const mq = window.matchMedia('(prefers-color-scheme: dark)');
1630        if ('onchange' in mq) {
1631          function mqChangeListener(e) {
1632            document.body.classList.toggle('dark-mode', e.matches);
1633          }
1634          mq.addEventListener('change', mqChangeListener);
1635          if (themeToggleButton) {
1636            themeToggleButton.addEventListener('click', function() {
1637              mq.removeEventListener('change', mqChangeListener);
1638            }, { once: true });
1639          }
1640        }
1641        if (mq.matches) {
1642          document.body.classList.add('dark-mode');
1643        }
1644      } else if (userSettings === 'true') {
1645        document.body.classList.add('dark-mode');
1646      }
1647      if (themeToggleButton) {
1648        themeToggleButton.hidden = false;
1649        themeToggleButton.addEventListener('click', function() {
1650          sessionStorage.setItem(
1651            kCustomPreference,
1652            document.body.classList.toggle('dark-mode')
1653          );
1654        });
1655      }
1656    }
1657  </script>
1658</body>
1659</html>
1660