11cb0ef41Sopenharmony_ci<!DOCTYPE html> 21cb0ef41Sopenharmony_ci<html lang="en"> 31cb0ef41Sopenharmony_ci<head> 41cb0ef41Sopenharmony_ci <meta charset="utf-8"> 51cb0ef41Sopenharmony_ci <meta name="viewport" content="width=device-width"> 61cb0ef41Sopenharmony_ci <meta name="nodejs.org:node-version" content="v18.20.1"> 71cb0ef41Sopenharmony_ci <title>Command-line API | Node.js v18.20.1 Documentation</title> 81cb0ef41Sopenharmony_ci <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic&display=fallback"> 91cb0ef41Sopenharmony_ci <link rel="stylesheet" href="assets/style.css"> 101cb0ef41Sopenharmony_ci <link rel="stylesheet" href="assets/hljs.css"> 111cb0ef41Sopenharmony_ci <link rel="canonical" href="https://nodejs.org/api/cli.html"> 121cb0ef41Sopenharmony_ci <script async defer src="assets/api.js" type="text/javascript"></script> 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci</head> 151cb0ef41Sopenharmony_ci<body class="alt apidoc" id="api-section-cli"> 161cb0ef41Sopenharmony_ci <div id="content" class="clearfix"> 171cb0ef41Sopenharmony_ci <div id="column2" class="interior"> 181cb0ef41Sopenharmony_ci <div id="intro" class="interior"> 191cb0ef41Sopenharmony_ci <a href="/" title="Go back to the home page"> 201cb0ef41Sopenharmony_ci Node.js 211cb0ef41Sopenharmony_ci </a> 221cb0ef41Sopenharmony_ci </div> 231cb0ef41Sopenharmony_ci <ul> 241cb0ef41Sopenharmony_ci<li><a href="documentation.html" class="nav-documentation">About this documentation</a></li> 251cb0ef41Sopenharmony_ci<li><a href="synopsis.html" class="nav-synopsis">Usage and example</a></li> 261cb0ef41Sopenharmony_ci</ul> 271cb0ef41Sopenharmony_ci<hr class="line"> 281cb0ef41Sopenharmony_ci<ul> 291cb0ef41Sopenharmony_ci<li><a href="assert.html" class="nav-assert">Assertion testing</a></li> 301cb0ef41Sopenharmony_ci<li><a href="async_context.html" class="nav-async_context">Asynchronous context tracking</a></li> 311cb0ef41Sopenharmony_ci<li><a href="async_hooks.html" class="nav-async_hooks">Async hooks</a></li> 321cb0ef41Sopenharmony_ci<li><a href="buffer.html" class="nav-buffer">Buffer</a></li> 331cb0ef41Sopenharmony_ci<li><a href="addons.html" class="nav-addons">C++ addons</a></li> 341cb0ef41Sopenharmony_ci<li><a href="n-api.html" class="nav-n-api">C/C++ addons with Node-API</a></li> 351cb0ef41Sopenharmony_ci<li><a href="embedding.html" class="nav-embedding">C++ embedder API</a></li> 361cb0ef41Sopenharmony_ci<li><a href="child_process.html" class="nav-child_process">Child processes</a></li> 371cb0ef41Sopenharmony_ci<li><a href="cluster.html" class="nav-cluster">Cluster</a></li> 381cb0ef41Sopenharmony_ci<li><a href="cli.html" class="nav-cli active">Command-line options</a></li> 391cb0ef41Sopenharmony_ci<li><a href="console.html" class="nav-console">Console</a></li> 401cb0ef41Sopenharmony_ci<li><a href="corepack.html" class="nav-corepack">Corepack</a></li> 411cb0ef41Sopenharmony_ci<li><a href="crypto.html" class="nav-crypto">Crypto</a></li> 421cb0ef41Sopenharmony_ci<li><a href="debugger.html" class="nav-debugger">Debugger</a></li> 431cb0ef41Sopenharmony_ci<li><a href="deprecations.html" class="nav-deprecations">Deprecated APIs</a></li> 441cb0ef41Sopenharmony_ci<li><a href="diagnostics_channel.html" class="nav-diagnostics_channel">Diagnostics Channel</a></li> 451cb0ef41Sopenharmony_ci<li><a href="dns.html" class="nav-dns">DNS</a></li> 461cb0ef41Sopenharmony_ci<li><a href="domain.html" class="nav-domain">Domain</a></li> 471cb0ef41Sopenharmony_ci<li><a href="errors.html" class="nav-errors">Errors</a></li> 481cb0ef41Sopenharmony_ci<li><a href="events.html" class="nav-events">Events</a></li> 491cb0ef41Sopenharmony_ci<li><a href="fs.html" class="nav-fs">File system</a></li> 501cb0ef41Sopenharmony_ci<li><a href="globals.html" class="nav-globals">Globals</a></li> 511cb0ef41Sopenharmony_ci<li><a href="http.html" class="nav-http">HTTP</a></li> 521cb0ef41Sopenharmony_ci<li><a href="http2.html" class="nav-http2">HTTP/2</a></li> 531cb0ef41Sopenharmony_ci<li><a href="https.html" class="nav-https">HTTPS</a></li> 541cb0ef41Sopenharmony_ci<li><a href="inspector.html" class="nav-inspector">Inspector</a></li> 551cb0ef41Sopenharmony_ci<li><a href="intl.html" class="nav-intl">Internationalization</a></li> 561cb0ef41Sopenharmony_ci<li><a href="modules.html" class="nav-modules">Modules: CommonJS modules</a></li> 571cb0ef41Sopenharmony_ci<li><a href="esm.html" class="nav-esm">Modules: ECMAScript modules</a></li> 581cb0ef41Sopenharmony_ci<li><a href="module.html" class="nav-module">Modules: <code>node:module</code> API</a></li> 591cb0ef41Sopenharmony_ci<li><a href="packages.html" class="nav-packages">Modules: Packages</a></li> 601cb0ef41Sopenharmony_ci<li><a href="net.html" class="nav-net">Net</a></li> 611cb0ef41Sopenharmony_ci<li><a href="os.html" class="nav-os">OS</a></li> 621cb0ef41Sopenharmony_ci<li><a href="path.html" class="nav-path">Path</a></li> 631cb0ef41Sopenharmony_ci<li><a href="perf_hooks.html" class="nav-perf_hooks">Performance hooks</a></li> 641cb0ef41Sopenharmony_ci<li><a href="permissions.html" class="nav-permissions">Permissions</a></li> 651cb0ef41Sopenharmony_ci<li><a href="process.html" class="nav-process">Process</a></li> 661cb0ef41Sopenharmony_ci<li><a href="punycode.html" class="nav-punycode">Punycode</a></li> 671cb0ef41Sopenharmony_ci<li><a href="querystring.html" class="nav-querystring">Query strings</a></li> 681cb0ef41Sopenharmony_ci<li><a href="readline.html" class="nav-readline">Readline</a></li> 691cb0ef41Sopenharmony_ci<li><a href="repl.html" class="nav-repl">REPL</a></li> 701cb0ef41Sopenharmony_ci<li><a href="report.html" class="nav-report">Report</a></li> 711cb0ef41Sopenharmony_ci<li><a href="single-executable-applications.html" class="nav-single-executable-applications">Single executable applications</a></li> 721cb0ef41Sopenharmony_ci<li><a href="stream.html" class="nav-stream">Stream</a></li> 731cb0ef41Sopenharmony_ci<li><a href="string_decoder.html" class="nav-string_decoder">String decoder</a></li> 741cb0ef41Sopenharmony_ci<li><a href="test.html" class="nav-test">Test runner</a></li> 751cb0ef41Sopenharmony_ci<li><a href="timers.html" class="nav-timers">Timers</a></li> 761cb0ef41Sopenharmony_ci<li><a href="tls.html" class="nav-tls">TLS/SSL</a></li> 771cb0ef41Sopenharmony_ci<li><a href="tracing.html" class="nav-tracing">Trace events</a></li> 781cb0ef41Sopenharmony_ci<li><a href="tty.html" class="nav-tty">TTY</a></li> 791cb0ef41Sopenharmony_ci<li><a href="dgram.html" class="nav-dgram">UDP/datagram</a></li> 801cb0ef41Sopenharmony_ci<li><a href="url.html" class="nav-url">URL</a></li> 811cb0ef41Sopenharmony_ci<li><a href="util.html" class="nav-util">Utilities</a></li> 821cb0ef41Sopenharmony_ci<li><a href="v8.html" class="nav-v8">V8</a></li> 831cb0ef41Sopenharmony_ci<li><a href="vm.html" class="nav-vm">VM</a></li> 841cb0ef41Sopenharmony_ci<li><a href="wasi.html" class="nav-wasi">WASI</a></li> 851cb0ef41Sopenharmony_ci<li><a href="webcrypto.html" class="nav-webcrypto">Web Crypto API</a></li> 861cb0ef41Sopenharmony_ci<li><a href="webstreams.html" class="nav-webstreams">Web Streams API</a></li> 871cb0ef41Sopenharmony_ci<li><a href="worker_threads.html" class="nav-worker_threads">Worker threads</a></li> 881cb0ef41Sopenharmony_ci<li><a href="zlib.html" class="nav-zlib">Zlib</a></li> 891cb0ef41Sopenharmony_ci</ul> 901cb0ef41Sopenharmony_ci<hr class="line"> 911cb0ef41Sopenharmony_ci<ul> 921cb0ef41Sopenharmony_ci<li><a href="https://github.com/nodejs/node" class="nav-https-github-com-nodejs-node">Code repository and issue tracker</a></li> 931cb0ef41Sopenharmony_ci</ul> 941cb0ef41Sopenharmony_ci </div> 951cb0ef41Sopenharmony_ci 961cb0ef41Sopenharmony_ci <div id="column1" data-id="cli" class="interior"> 971cb0ef41Sopenharmony_ci <header class="header"> 981cb0ef41Sopenharmony_ci <div class="header-container"> 991cb0ef41Sopenharmony_ci <h1>Node.js v18.20.1 documentation</h1> 1001cb0ef41Sopenharmony_ci <button class="theme-toggle-btn" id="theme-toggle-btn" title="Toggle dark mode/light mode" aria-label="Toggle dark mode/light mode" hidden> 1011cb0ef41Sopenharmony_ci <svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" height="24" width="24"> 1021cb0ef41Sopenharmony_ci <path fill="none" d="M0 0h24v24H0z" /> 1031cb0ef41Sopenharmony_ci <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"/> 1041cb0ef41Sopenharmony_ci <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"/> 1051cb0ef41Sopenharmony_ci </svg> 1061cb0ef41Sopenharmony_ci <svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" height="24" width="24"> 1071cb0ef41Sopenharmony_ci <path d="M0 0h24v24H0z" fill="none" /> 1081cb0ef41Sopenharmony_ci <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"/> 1091cb0ef41Sopenharmony_ci </svg> 1101cb0ef41Sopenharmony_ci </button> 1111cb0ef41Sopenharmony_ci </div> 1121cb0ef41Sopenharmony_ci <div id="gtoc"> 1131cb0ef41Sopenharmony_ci <ul> 1141cb0ef41Sopenharmony_ci <li class="pinned-header">Node.js v18.20.1</li> 1151cb0ef41Sopenharmony_ci 1161cb0ef41Sopenharmony_ci <li class="picker-header"> 1171cb0ef41Sopenharmony_ci <a href="#"> 1181cb0ef41Sopenharmony_ci <span class="collapsed-arrow">►</span><span class="expanded-arrow">▼</span> 1191cb0ef41Sopenharmony_ci Table of contents 1201cb0ef41Sopenharmony_ci </a> 1211cb0ef41Sopenharmony_ci 1221cb0ef41Sopenharmony_ci <div class="picker"><div class="toc"><ul> 1231cb0ef41Sopenharmony_ci<li><a href="#command-line-api">Command-line API</a> 1241cb0ef41Sopenharmony_ci<ul> 1251cb0ef41Sopenharmony_ci<li><a href="#synopsis">Synopsis</a></li> 1261cb0ef41Sopenharmony_ci<li><a href="#program-entry-point">Program entry point</a> 1271cb0ef41Sopenharmony_ci<ul> 1281cb0ef41Sopenharmony_ci<li><a href="#ecmascript-modules-loader-entry-point-caveat">ECMAScript modules loader entry point caveat</a></li> 1291cb0ef41Sopenharmony_ci</ul> 1301cb0ef41Sopenharmony_ci</li> 1311cb0ef41Sopenharmony_ci<li><a href="#options">Options</a> 1321cb0ef41Sopenharmony_ci<ul> 1331cb0ef41Sopenharmony_ci<li><a href="#-"><code>-</code></a></li> 1341cb0ef41Sopenharmony_ci<li><a href="#--"><code>--</code></a></li> 1351cb0ef41Sopenharmony_ci<li><a href="#--abort-on-uncaught-exception"><code>--abort-on-uncaught-exception</code></a></li> 1361cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--build-snapshot"><code>--build-snapshot</code></a></span></li> 1371cb0ef41Sopenharmony_ci<li><a href="#--completion-bash"><code>--completion-bash</code></a></li> 1381cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#-c-condition---conditionscondition"><code>-C condition</code>, <code>--conditions=condition</code></a></span></li> 1391cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--cpu-prof"><code>--cpu-prof</code></a></span></li> 1401cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--cpu-prof-dir"><code>--cpu-prof-dir</code></a></span></li> 1411cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--cpu-prof-interval"><code>--cpu-prof-interval</code></a></span></li> 1421cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--cpu-prof-name"><code>--cpu-prof-name</code></a></span></li> 1431cb0ef41Sopenharmony_ci<li><a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir=directory</code></a></li> 1441cb0ef41Sopenharmony_ci<li><a href="#--disable-protomode"><code>--disable-proto=mode</code></a></li> 1451cb0ef41Sopenharmony_ci<li><a href="#--disallow-code-generation-from-strings"><code>--disallow-code-generation-from-strings</code></a></li> 1461cb0ef41Sopenharmony_ci<li><a href="#--dns-result-orderorder"><code>--dns-result-order=order</code></a></li> 1471cb0ef41Sopenharmony_ci<li><a href="#--enable-fips"><code>--enable-fips</code></a></li> 1481cb0ef41Sopenharmony_ci<li><a href="#--enable-network-family-autoselection"><code>--enable-network-family-autoselection</code></a></li> 1491cb0ef41Sopenharmony_ci<li><a href="#--enable-source-maps"><code>--enable-source-maps</code></a></li> 1501cb0ef41Sopenharmony_ci<li><a href="#--experimental-global-customevent"><code>--experimental-global-customevent</code></a></li> 1511cb0ef41Sopenharmony_ci<li><a href="#--experimental-global-webcrypto"><code>--experimental-global-webcrypto</code></a></li> 1521cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--experimental-default-typetype"><code>--experimental-default-type=type</code></a></span></li> 1531cb0ef41Sopenharmony_ci<li><a href="#--experimental-import-meta-resolve"><code>--experimental-import-meta-resolve</code></a></li> 1541cb0ef41Sopenharmony_ci<li><a href="#--experimental-loadermodule"><code>--experimental-loader=module</code></a></li> 1551cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--experimental-network-imports"><code>--experimental-network-imports</code></a></span></li> 1561cb0ef41Sopenharmony_ci<li><a href="#--experimental-policy"><code>--experimental-policy</code></a></li> 1571cb0ef41Sopenharmony_ci<li><a href="#--no-experimental-fetch"><code>--no-experimental-fetch</code></a></li> 1581cb0ef41Sopenharmony_ci<li><a href="#--no-experimental-repl-await"><code>--no-experimental-repl-await</code></a></li> 1591cb0ef41Sopenharmony_ci<li><a href="#--experimental-shadow-realm"><code>--experimental-shadow-realm</code></a></li> 1601cb0ef41Sopenharmony_ci<li><a href="#--experimental-specifier-resolutionmode"><code>--experimental-specifier-resolution=mode</code></a></li> 1611cb0ef41Sopenharmony_ci<li><a href="#--experimental-test-coverage"><code>--experimental-test-coverage</code></a></li> 1621cb0ef41Sopenharmony_ci<li><a href="#--experimental-vm-modules"><code>--experimental-vm-modules</code></a></li> 1631cb0ef41Sopenharmony_ci<li><a href="#--experimental-wasi-unstable-preview1"><code>--experimental-wasi-unstable-preview1</code></a></li> 1641cb0ef41Sopenharmony_ci<li><a href="#--experimental-wasm-modules"><code>--experimental-wasm-modules</code></a></li> 1651cb0ef41Sopenharmony_ci<li><a href="#--force-context-aware"><code>--force-context-aware</code></a></li> 1661cb0ef41Sopenharmony_ci<li><a href="#--force-fips"><code>--force-fips</code></a></li> 1671cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--frozen-intrinsics"><code>--frozen-intrinsics</code></a></span></li> 1681cb0ef41Sopenharmony_ci<li><a href="#--force-node-api-uncaught-exceptions-policy"><code>--force-node-api-uncaught-exceptions-policy</code></a></li> 1691cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heapsnapshot-near-heap-limitmax_count"><code>--heapsnapshot-near-heap-limit=max_count</code></a></span></li> 1701cb0ef41Sopenharmony_ci<li><a href="#--heapsnapshot-signalsignal"><code>--heapsnapshot-signal=signal</code></a></li> 1711cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heap-prof"><code>--heap-prof</code></a></span></li> 1721cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heap-prof-dir"><code>--heap-prof-dir</code></a></span></li> 1731cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heap-prof-interval"><code>--heap-prof-interval</code></a></span></li> 1741cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heap-prof-name"><code>--heap-prof-name</code></a></span></li> 1751cb0ef41Sopenharmony_ci<li><a href="#--icu-data-dirfile"><code>--icu-data-dir=file</code></a></li> 1761cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--importmodule"><code>--import=module</code></a></span></li> 1771cb0ef41Sopenharmony_ci<li><a href="#--input-typetype"><code>--input-type=type</code></a></li> 1781cb0ef41Sopenharmony_ci<li><a href="#--inspect-brkhostport"><code>--inspect-brk[=[host:]port]</code></a></li> 1791cb0ef41Sopenharmony_ci<li><a href="#--inspect-porthostport"><code>--inspect-port=[host:]port</code></a></li> 1801cb0ef41Sopenharmony_ci<li><a href="#--inspecthostport"><code>--inspect[=[host:]port]</code></a> 1811cb0ef41Sopenharmony_ci<ul> 1821cb0ef41Sopenharmony_ci<li><a href="#warning-binding-inspector-to-a-public-ipport-combination-is-insecure">Warning: binding inspector to a public IP:port combination is insecure</a></li> 1831cb0ef41Sopenharmony_ci</ul> 1841cb0ef41Sopenharmony_ci</li> 1851cb0ef41Sopenharmony_ci<li><a href="#--inspect-publish-uidstderrhttp"><code>--inspect-publish-uid=stderr,http</code></a></li> 1861cb0ef41Sopenharmony_ci<li><a href="#--insecure-http-parser"><code>--insecure-http-parser</code></a></li> 1871cb0ef41Sopenharmony_ci<li><a href="#--jitless"><code>--jitless</code></a></li> 1881cb0ef41Sopenharmony_ci<li><a href="#--max-http-header-sizesize"><code>--max-http-header-size=size</code></a></li> 1891cb0ef41Sopenharmony_ci<li><a href="#--napi-modules"><code>--napi-modules</code></a></li> 1901cb0ef41Sopenharmony_ci<li><a href="#--no-addons"><code>--no-addons</code></a></li> 1911cb0ef41Sopenharmony_ci<li><a href="#--no-deprecation"><code>--no-deprecation</code></a></li> 1921cb0ef41Sopenharmony_ci<li><a href="#--no-extra-info-on-fatal-exception"><code>--no-extra-info-on-fatal-exception</code></a></li> 1931cb0ef41Sopenharmony_ci<li><a href="#--no-force-async-hooks-checks"><code>--no-force-async-hooks-checks</code></a></li> 1941cb0ef41Sopenharmony_ci<li><a href="#--no-global-search-paths"><code>--no-global-search-paths</code></a></li> 1951cb0ef41Sopenharmony_ci<li><a href="#--no-warnings"><code>--no-warnings</code></a></li> 1961cb0ef41Sopenharmony_ci<li><a href="#--node-memory-debug"><code>--node-memory-debug</code></a></li> 1971cb0ef41Sopenharmony_ci<li><a href="#--openssl-configfile"><code>--openssl-config=file</code></a></li> 1981cb0ef41Sopenharmony_ci<li><a href="#--openssl-shared-config"><code>--openssl-shared-config</code></a></li> 1991cb0ef41Sopenharmony_ci<li><a href="#--openssl-legacy-provider"><code>--openssl-legacy-provider</code></a></li> 2001cb0ef41Sopenharmony_ci<li><a href="#--pending-deprecation"><code>--pending-deprecation</code></a></li> 2011cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--policy-integritysri"><code>--policy-integrity=sri</code></a></span></li> 2021cb0ef41Sopenharmony_ci<li><a href="#--preserve-symlinks"><code>--preserve-symlinks</code></a></li> 2031cb0ef41Sopenharmony_ci<li><a href="#--preserve-symlinks-main"><code>--preserve-symlinks-main</code></a></li> 2041cb0ef41Sopenharmony_ci<li><a href="#--prof"><code>--prof</code></a></li> 2051cb0ef41Sopenharmony_ci<li><a href="#--prof-process"><code>--prof-process</code></a></li> 2061cb0ef41Sopenharmony_ci<li><a href="#--redirect-warningsfile"><code>--redirect-warnings=file</code></a></li> 2071cb0ef41Sopenharmony_ci<li><a href="#--report-compact"><code>--report-compact</code></a></li> 2081cb0ef41Sopenharmony_ci<li><a href="#--report-dirdirectory-report-directorydirectory"><code>--report-dir=directory</code>, <code>report-directory=directory</code></a></li> 2091cb0ef41Sopenharmony_ci<li><a href="#--report-filenamefilename"><code>--report-filename=filename</code></a></li> 2101cb0ef41Sopenharmony_ci<li><a href="#--report-on-fatalerror"><code>--report-on-fatalerror</code></a></li> 2111cb0ef41Sopenharmony_ci<li><a href="#--report-on-signal"><code>--report-on-signal</code></a></li> 2121cb0ef41Sopenharmony_ci<li><a href="#--report-signalsignal"><code>--report-signal=signal</code></a></li> 2131cb0ef41Sopenharmony_ci<li><a href="#--report-uncaught-exception"><code>--report-uncaught-exception</code></a></li> 2141cb0ef41Sopenharmony_ci<li><a href="#--secure-heapn"><code>--secure-heap=n</code></a></li> 2151cb0ef41Sopenharmony_ci<li><a href="#--secure-heap-minn"><code>--secure-heap-min=n</code></a></li> 2161cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--snapshot-blobpath"><code>--snapshot-blob=path</code></a></span></li> 2171cb0ef41Sopenharmony_ci<li><a href="#--test"><code>--test</code></a></li> 2181cb0ef41Sopenharmony_ci<li><a href="#--test-concurrency"><code>--test-concurrency</code></a></li> 2191cb0ef41Sopenharmony_ci<li><a href="#--test-name-pattern"><code>--test-name-pattern</code></a></li> 2201cb0ef41Sopenharmony_ci<li><a href="#--test-reporter"><code>--test-reporter</code></a></li> 2211cb0ef41Sopenharmony_ci<li><a href="#--test-reporter-destination"><code>--test-reporter-destination</code></a></li> 2221cb0ef41Sopenharmony_ci<li><a href="#--test-only"><code>--test-only</code></a></li> 2231cb0ef41Sopenharmony_ci<li><a href="#--test-shard"><code>--test-shard</code></a></li> 2241cb0ef41Sopenharmony_ci<li><a href="#--throw-deprecation"><code>--throw-deprecation</code></a></li> 2251cb0ef41Sopenharmony_ci<li><a href="#--titletitle"><code>--title=title</code></a></li> 2261cb0ef41Sopenharmony_ci<li><a href="#--tls-cipher-listlist"><code>--tls-cipher-list=list</code></a></li> 2271cb0ef41Sopenharmony_ci<li><a href="#--tls-keylogfile"><code>--tls-keylog=file</code></a></li> 2281cb0ef41Sopenharmony_ci<li><a href="#--tls-max-v12"><code>--tls-max-v1.2</code></a></li> 2291cb0ef41Sopenharmony_ci<li><a href="#--tls-max-v13"><code>--tls-max-v1.3</code></a></li> 2301cb0ef41Sopenharmony_ci<li><a href="#--tls-min-v10"><code>--tls-min-v1.0</code></a></li> 2311cb0ef41Sopenharmony_ci<li><a href="#--tls-min-v11"><code>--tls-min-v1.1</code></a></li> 2321cb0ef41Sopenharmony_ci<li><a href="#--tls-min-v12"><code>--tls-min-v1.2</code></a></li> 2331cb0ef41Sopenharmony_ci<li><a href="#--tls-min-v13"><code>--tls-min-v1.3</code></a></li> 2341cb0ef41Sopenharmony_ci<li><span class="stability_0"><a href="#--trace-atomics-wait"><code>--trace-atomics-wait</code></a></span></li> 2351cb0ef41Sopenharmony_ci<li><a href="#--trace-deprecation"><code>--trace-deprecation</code></a></li> 2361cb0ef41Sopenharmony_ci<li><a href="#--trace-event-categories"><code>--trace-event-categories</code></a></li> 2371cb0ef41Sopenharmony_ci<li><a href="#--trace-event-file-pattern"><code>--trace-event-file-pattern</code></a></li> 2381cb0ef41Sopenharmony_ci<li><a href="#--trace-events-enabled"><code>--trace-events-enabled</code></a></li> 2391cb0ef41Sopenharmony_ci<li><a href="#--trace-exit"><code>--trace-exit</code></a></li> 2401cb0ef41Sopenharmony_ci<li><a href="#--trace-sigint"><code>--trace-sigint</code></a></li> 2411cb0ef41Sopenharmony_ci<li><a href="#--trace-sync-io"><code>--trace-sync-io</code></a></li> 2421cb0ef41Sopenharmony_ci<li><a href="#--trace-tls"><code>--trace-tls</code></a></li> 2431cb0ef41Sopenharmony_ci<li><a href="#--trace-uncaught"><code>--trace-uncaught</code></a></li> 2441cb0ef41Sopenharmony_ci<li><a href="#--trace-warnings"><code>--trace-warnings</code></a></li> 2451cb0ef41Sopenharmony_ci<li><a href="#--track-heap-objects"><code>--track-heap-objects</code></a></li> 2461cb0ef41Sopenharmony_ci<li><a href="#--unhandled-rejectionsmode"><code>--unhandled-rejections=mode</code></a></li> 2471cb0ef41Sopenharmony_ci<li><a href="#--use-bundled-ca---use-openssl-ca"><code>--use-bundled-ca</code>, <code>--use-openssl-ca</code></a></li> 2481cb0ef41Sopenharmony_ci<li><a href="#--use-largepagesmode"><code>--use-largepages=mode</code></a></li> 2491cb0ef41Sopenharmony_ci<li><a href="#--v8-options"><code>--v8-options</code></a></li> 2501cb0ef41Sopenharmony_ci<li><a href="#--v8-pool-sizenum"><code>--v8-pool-size=num</code></a></li> 2511cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--watch"><code>--watch</code></a></span></li> 2521cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--watch-path"><code>--watch-path</code></a></span></li> 2531cb0ef41Sopenharmony_ci<li><a href="#--watch-preserve-output"><code>--watch-preserve-output</code></a></li> 2541cb0ef41Sopenharmony_ci<li><a href="#--zero-fill-buffers"><code>--zero-fill-buffers</code></a></li> 2551cb0ef41Sopenharmony_ci<li><a href="#-c---check"><code>-c</code>, <code>--check</code></a></li> 2561cb0ef41Sopenharmony_ci<li><a href="#-e---eval-script"><code>-e</code>, <code>--eval "script"</code></a></li> 2571cb0ef41Sopenharmony_ci<li><a href="#-h---help"><code>-h</code>, <code>--help</code></a></li> 2581cb0ef41Sopenharmony_ci<li><a href="#-i---interactive"><code>-i</code>, <code>--interactive</code></a></li> 2591cb0ef41Sopenharmony_ci<li><a href="#-p---print-script"><code>-p</code>, <code>--print "script"</code></a></li> 2601cb0ef41Sopenharmony_ci<li><a href="#-r---require-module"><code>-r</code>, <code>--require module</code></a></li> 2611cb0ef41Sopenharmony_ci<li><a href="#-v---version"><code>-v</code>, <code>--version</code></a></li> 2621cb0ef41Sopenharmony_ci</ul> 2631cb0ef41Sopenharmony_ci</li> 2641cb0ef41Sopenharmony_ci<li><a href="#environment-variables">Environment variables</a> 2651cb0ef41Sopenharmony_ci<ul> 2661cb0ef41Sopenharmony_ci<li><a href="#force_color1-2-3"><code>FORCE_COLOR=[1, 2, 3]</code></a></li> 2671cb0ef41Sopenharmony_ci<li><a href="#node_debugmodule"><code>NODE_DEBUG=module[,…]</code></a></li> 2681cb0ef41Sopenharmony_ci<li><a href="#node_debug_nativemodule"><code>NODE_DEBUG_NATIVE=module[,…]</code></a></li> 2691cb0ef41Sopenharmony_ci<li><a href="#node_disable_colors1"><code>NODE_DISABLE_COLORS=1</code></a></li> 2701cb0ef41Sopenharmony_ci<li><a href="#node_extra_ca_certsfile"><code>NODE_EXTRA_CA_CERTS=file</code></a></li> 2711cb0ef41Sopenharmony_ci<li><a href="#node_icu_datafile"><code>NODE_ICU_DATA=file</code></a></li> 2721cb0ef41Sopenharmony_ci<li><a href="#node_no_warnings1"><code>NODE_NO_WARNINGS=1</code></a></li> 2731cb0ef41Sopenharmony_ci<li><a href="#node_optionsoptions"><code>NODE_OPTIONS=options...</code></a></li> 2741cb0ef41Sopenharmony_ci<li><a href="#node_pathpath"><code>NODE_PATH=path[:…]</code></a></li> 2751cb0ef41Sopenharmony_ci<li><a href="#node_pending_deprecation1"><code>NODE_PENDING_DEPRECATION=1</code></a></li> 2761cb0ef41Sopenharmony_ci<li><a href="#node_pending_pipe_instancesinstances"><code>NODE_PENDING_PIPE_INSTANCES=instances</code></a></li> 2771cb0ef41Sopenharmony_ci<li><a href="#node_preserve_symlinks1"><code>NODE_PRESERVE_SYMLINKS=1</code></a></li> 2781cb0ef41Sopenharmony_ci<li><a href="#node_redirect_warningsfile"><code>NODE_REDIRECT_WARNINGS=file</code></a></li> 2791cb0ef41Sopenharmony_ci<li><a href="#node_repl_historyfile"><code>NODE_REPL_HISTORY=file</code></a></li> 2801cb0ef41Sopenharmony_ci<li><a href="#node_repl_external_modulefile"><code>NODE_REPL_EXTERNAL_MODULE=file</code></a></li> 2811cb0ef41Sopenharmony_ci<li><a href="#node_skip_platform_checkvalue"><code>NODE_SKIP_PLATFORM_CHECK=value</code></a></li> 2821cb0ef41Sopenharmony_ci<li><a href="#node_test_contextvalue"><code>NODE_TEST_CONTEXT=value</code></a></li> 2831cb0ef41Sopenharmony_ci<li><a href="#node_tls_reject_unauthorizedvalue"><code>NODE_TLS_REJECT_UNAUTHORIZED=value</code></a></li> 2841cb0ef41Sopenharmony_ci<li><a href="#node_v8_coveragedir"><code>NODE_V8_COVERAGE=dir</code></a> 2851cb0ef41Sopenharmony_ci<ul> 2861cb0ef41Sopenharmony_ci<li><a href="#coverage-output">Coverage output</a></li> 2871cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#source-map-cache">Source map cache</a></span></li> 2881cb0ef41Sopenharmony_ci</ul> 2891cb0ef41Sopenharmony_ci</li> 2901cb0ef41Sopenharmony_ci<li><a href="#no_colorany"><code>NO_COLOR=<any></code></a></li> 2911cb0ef41Sopenharmony_ci<li><a href="#openssl_conffile"><code>OPENSSL_CONF=file</code></a></li> 2921cb0ef41Sopenharmony_ci<li><a href="#ssl_cert_dirdir"><code>SSL_CERT_DIR=dir</code></a></li> 2931cb0ef41Sopenharmony_ci<li><a href="#ssl_cert_filefile"><code>SSL_CERT_FILE=file</code></a></li> 2941cb0ef41Sopenharmony_ci<li><a href="#tz"><code>TZ</code></a></li> 2951cb0ef41Sopenharmony_ci<li><a href="#uv_threadpool_sizesize"><code>UV_THREADPOOL_SIZE=size</code></a></li> 2961cb0ef41Sopenharmony_ci</ul> 2971cb0ef41Sopenharmony_ci</li> 2981cb0ef41Sopenharmony_ci<li><a href="#useful-v8-options">Useful V8 options</a> 2991cb0ef41Sopenharmony_ci<ul> 3001cb0ef41Sopenharmony_ci<li><a href="#--max-old-space-sizesize-in-megabytes"><code>--max-old-space-size=SIZE</code> (in megabytes)</a></li> 3011cb0ef41Sopenharmony_ci<li><a href="#--max-semi-space-sizesize-in-megabytes"><code>--max-semi-space-size=SIZE</code> (in megabytes)</a></li> 3021cb0ef41Sopenharmony_ci</ul> 3031cb0ef41Sopenharmony_ci</li> 3041cb0ef41Sopenharmony_ci</ul> 3051cb0ef41Sopenharmony_ci</li> 3061cb0ef41Sopenharmony_ci</ul></div></div> 3071cb0ef41Sopenharmony_ci </li> 3081cb0ef41Sopenharmony_ci 3091cb0ef41Sopenharmony_ci 3101cb0ef41Sopenharmony_ci <li class="picker-header"> 3111cb0ef41Sopenharmony_ci <a href="#"> 3121cb0ef41Sopenharmony_ci <span class="collapsed-arrow">►</span><span class="expanded-arrow">▼</span> 3131cb0ef41Sopenharmony_ci Index 3141cb0ef41Sopenharmony_ci </a> 3151cb0ef41Sopenharmony_ci 3161cb0ef41Sopenharmony_ci <div class="picker"><ul> 3171cb0ef41Sopenharmony_ci<li><a href="documentation.html" class="nav-documentation">About this documentation</a></li> 3181cb0ef41Sopenharmony_ci<li><a href="synopsis.html" class="nav-synopsis">Usage and example</a></li> 3191cb0ef41Sopenharmony_ci 3201cb0ef41Sopenharmony_ci <li> 3211cb0ef41Sopenharmony_ci <a href="index.html">Index</a> 3221cb0ef41Sopenharmony_ci </li> 3231cb0ef41Sopenharmony_ci </ul> 3241cb0ef41Sopenharmony_ci 3251cb0ef41Sopenharmony_ci<hr class="line"> 3261cb0ef41Sopenharmony_ci<ul> 3271cb0ef41Sopenharmony_ci<li><a href="assert.html" class="nav-assert">Assertion testing</a></li> 3281cb0ef41Sopenharmony_ci<li><a href="async_context.html" class="nav-async_context">Asynchronous context tracking</a></li> 3291cb0ef41Sopenharmony_ci<li><a href="async_hooks.html" class="nav-async_hooks">Async hooks</a></li> 3301cb0ef41Sopenharmony_ci<li><a href="buffer.html" class="nav-buffer">Buffer</a></li> 3311cb0ef41Sopenharmony_ci<li><a href="addons.html" class="nav-addons">C++ addons</a></li> 3321cb0ef41Sopenharmony_ci<li><a href="n-api.html" class="nav-n-api">C/C++ addons with Node-API</a></li> 3331cb0ef41Sopenharmony_ci<li><a href="embedding.html" class="nav-embedding">C++ embedder API</a></li> 3341cb0ef41Sopenharmony_ci<li><a href="child_process.html" class="nav-child_process">Child processes</a></li> 3351cb0ef41Sopenharmony_ci<li><a href="cluster.html" class="nav-cluster">Cluster</a></li> 3361cb0ef41Sopenharmony_ci<li><a href="cli.html" class="nav-cli active">Command-line options</a></li> 3371cb0ef41Sopenharmony_ci<li><a href="console.html" class="nav-console">Console</a></li> 3381cb0ef41Sopenharmony_ci<li><a href="corepack.html" class="nav-corepack">Corepack</a></li> 3391cb0ef41Sopenharmony_ci<li><a href="crypto.html" class="nav-crypto">Crypto</a></li> 3401cb0ef41Sopenharmony_ci<li><a href="debugger.html" class="nav-debugger">Debugger</a></li> 3411cb0ef41Sopenharmony_ci<li><a href="deprecations.html" class="nav-deprecations">Deprecated APIs</a></li> 3421cb0ef41Sopenharmony_ci<li><a href="diagnostics_channel.html" class="nav-diagnostics_channel">Diagnostics Channel</a></li> 3431cb0ef41Sopenharmony_ci<li><a href="dns.html" class="nav-dns">DNS</a></li> 3441cb0ef41Sopenharmony_ci<li><a href="domain.html" class="nav-domain">Domain</a></li> 3451cb0ef41Sopenharmony_ci<li><a href="errors.html" class="nav-errors">Errors</a></li> 3461cb0ef41Sopenharmony_ci<li><a href="events.html" class="nav-events">Events</a></li> 3471cb0ef41Sopenharmony_ci<li><a href="fs.html" class="nav-fs">File system</a></li> 3481cb0ef41Sopenharmony_ci<li><a href="globals.html" class="nav-globals">Globals</a></li> 3491cb0ef41Sopenharmony_ci<li><a href="http.html" class="nav-http">HTTP</a></li> 3501cb0ef41Sopenharmony_ci<li><a href="http2.html" class="nav-http2">HTTP/2</a></li> 3511cb0ef41Sopenharmony_ci<li><a href="https.html" class="nav-https">HTTPS</a></li> 3521cb0ef41Sopenharmony_ci<li><a href="inspector.html" class="nav-inspector">Inspector</a></li> 3531cb0ef41Sopenharmony_ci<li><a href="intl.html" class="nav-intl">Internationalization</a></li> 3541cb0ef41Sopenharmony_ci<li><a href="modules.html" class="nav-modules">Modules: CommonJS modules</a></li> 3551cb0ef41Sopenharmony_ci<li><a href="esm.html" class="nav-esm">Modules: ECMAScript modules</a></li> 3561cb0ef41Sopenharmony_ci<li><a href="module.html" class="nav-module">Modules: <code>node:module</code> API</a></li> 3571cb0ef41Sopenharmony_ci<li><a href="packages.html" class="nav-packages">Modules: Packages</a></li> 3581cb0ef41Sopenharmony_ci<li><a href="net.html" class="nav-net">Net</a></li> 3591cb0ef41Sopenharmony_ci<li><a href="os.html" class="nav-os">OS</a></li> 3601cb0ef41Sopenharmony_ci<li><a href="path.html" class="nav-path">Path</a></li> 3611cb0ef41Sopenharmony_ci<li><a href="perf_hooks.html" class="nav-perf_hooks">Performance hooks</a></li> 3621cb0ef41Sopenharmony_ci<li><a href="permissions.html" class="nav-permissions">Permissions</a></li> 3631cb0ef41Sopenharmony_ci<li><a href="process.html" class="nav-process">Process</a></li> 3641cb0ef41Sopenharmony_ci<li><a href="punycode.html" class="nav-punycode">Punycode</a></li> 3651cb0ef41Sopenharmony_ci<li><a href="querystring.html" class="nav-querystring">Query strings</a></li> 3661cb0ef41Sopenharmony_ci<li><a href="readline.html" class="nav-readline">Readline</a></li> 3671cb0ef41Sopenharmony_ci<li><a href="repl.html" class="nav-repl">REPL</a></li> 3681cb0ef41Sopenharmony_ci<li><a href="report.html" class="nav-report">Report</a></li> 3691cb0ef41Sopenharmony_ci<li><a href="single-executable-applications.html" class="nav-single-executable-applications">Single executable applications</a></li> 3701cb0ef41Sopenharmony_ci<li><a href="stream.html" class="nav-stream">Stream</a></li> 3711cb0ef41Sopenharmony_ci<li><a href="string_decoder.html" class="nav-string_decoder">String decoder</a></li> 3721cb0ef41Sopenharmony_ci<li><a href="test.html" class="nav-test">Test runner</a></li> 3731cb0ef41Sopenharmony_ci<li><a href="timers.html" class="nav-timers">Timers</a></li> 3741cb0ef41Sopenharmony_ci<li><a href="tls.html" class="nav-tls">TLS/SSL</a></li> 3751cb0ef41Sopenharmony_ci<li><a href="tracing.html" class="nav-tracing">Trace events</a></li> 3761cb0ef41Sopenharmony_ci<li><a href="tty.html" class="nav-tty">TTY</a></li> 3771cb0ef41Sopenharmony_ci<li><a href="dgram.html" class="nav-dgram">UDP/datagram</a></li> 3781cb0ef41Sopenharmony_ci<li><a href="url.html" class="nav-url">URL</a></li> 3791cb0ef41Sopenharmony_ci<li><a href="util.html" class="nav-util">Utilities</a></li> 3801cb0ef41Sopenharmony_ci<li><a href="v8.html" class="nav-v8">V8</a></li> 3811cb0ef41Sopenharmony_ci<li><a href="vm.html" class="nav-vm">VM</a></li> 3821cb0ef41Sopenharmony_ci<li><a href="wasi.html" class="nav-wasi">WASI</a></li> 3831cb0ef41Sopenharmony_ci<li><a href="webcrypto.html" class="nav-webcrypto">Web Crypto API</a></li> 3841cb0ef41Sopenharmony_ci<li><a href="webstreams.html" class="nav-webstreams">Web Streams API</a></li> 3851cb0ef41Sopenharmony_ci<li><a href="worker_threads.html" class="nav-worker_threads">Worker threads</a></li> 3861cb0ef41Sopenharmony_ci<li><a href="zlib.html" class="nav-zlib">Zlib</a></li> 3871cb0ef41Sopenharmony_ci</ul> 3881cb0ef41Sopenharmony_ci<hr class="line"> 3891cb0ef41Sopenharmony_ci<ul> 3901cb0ef41Sopenharmony_ci<li><a href="https://github.com/nodejs/node" class="nav-https-github-com-nodejs-node">Code repository and issue tracker</a></li> 3911cb0ef41Sopenharmony_ci</ul></div> 3921cb0ef41Sopenharmony_ci </li> 3931cb0ef41Sopenharmony_ci 3941cb0ef41Sopenharmony_ci 3951cb0ef41Sopenharmony_ci <li class="picker-header"> 3961cb0ef41Sopenharmony_ci <a href="#"> 3971cb0ef41Sopenharmony_ci <span class="collapsed-arrow">►</span><span class="expanded-arrow">▼</span> 3981cb0ef41Sopenharmony_ci Other versions 3991cb0ef41Sopenharmony_ci </a> 4001cb0ef41Sopenharmony_ci <div class="picker"><ol id="alt-docs"><li><a href="https://nodejs.org/docs/latest-v21.x/api/cli.html">21.x</a></li> 4011cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v20.x/api/cli.html">20.x <b>LTS</b></a></li> 4021cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v19.x/api/cli.html">19.x</a></li> 4031cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v18.x/api/cli.html">18.x <b>LTS</b></a></li> 4041cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v17.x/api/cli.html">17.x</a></li> 4051cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v16.x/api/cli.html">16.x</a></li> 4061cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v15.x/api/cli.html">15.x</a></li> 4071cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v14.x/api/cli.html">14.x</a></li> 4081cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v13.x/api/cli.html">13.x</a></li> 4091cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v12.x/api/cli.html">12.x</a></li> 4101cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v11.x/api/cli.html">11.x</a></li> 4111cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v10.x/api/cli.html">10.x</a></li> 4121cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v9.x/api/cli.html">9.x</a></li> 4131cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v8.x/api/cli.html">8.x</a></li> 4141cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v7.x/api/cli.html">7.x</a></li> 4151cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v6.x/api/cli.html">6.x</a></li> 4161cb0ef41Sopenharmony_ci<li><a href="https://nodejs.org/docs/latest-v5.x/api/cli.html">5.x</a></li></ol></div> 4171cb0ef41Sopenharmony_ci </li> 4181cb0ef41Sopenharmony_ci 4191cb0ef41Sopenharmony_ci <li class="picker-header"> 4201cb0ef41Sopenharmony_ci <a href="#"> 4211cb0ef41Sopenharmony_ci <span class="collapsed-arrow">►</span><span class="expanded-arrow">▼</span> 4221cb0ef41Sopenharmony_ci Options 4231cb0ef41Sopenharmony_ci </a> 4241cb0ef41Sopenharmony_ci 4251cb0ef41Sopenharmony_ci <div class="picker"> 4261cb0ef41Sopenharmony_ci <ul> 4271cb0ef41Sopenharmony_ci <li> 4281cb0ef41Sopenharmony_ci <a href="all.html">View on single page</a> 4291cb0ef41Sopenharmony_ci </li> 4301cb0ef41Sopenharmony_ci <li> 4311cb0ef41Sopenharmony_ci <a href="cli.json">View as JSON</a> 4321cb0ef41Sopenharmony_ci </li> 4331cb0ef41Sopenharmony_ci <li class="edit_on_github"><a href="https://github.com/nodejs/node/edit/main/doc/api/cli.md">Edit on GitHub</a></li> 4341cb0ef41Sopenharmony_ci </ul> 4351cb0ef41Sopenharmony_ci </div> 4361cb0ef41Sopenharmony_ci </li> 4371cb0ef41Sopenharmony_ci </ul> 4381cb0ef41Sopenharmony_ci </div> 4391cb0ef41Sopenharmony_ci <hr> 4401cb0ef41Sopenharmony_ci </header> 4411cb0ef41Sopenharmony_ci 4421cb0ef41Sopenharmony_ci <details id="toc" open><summary>Table of contents</summary><ul> 4431cb0ef41Sopenharmony_ci<li><a href="#command-line-api">Command-line API</a> 4441cb0ef41Sopenharmony_ci<ul> 4451cb0ef41Sopenharmony_ci<li><a href="#synopsis">Synopsis</a></li> 4461cb0ef41Sopenharmony_ci<li><a href="#program-entry-point">Program entry point</a> 4471cb0ef41Sopenharmony_ci<ul> 4481cb0ef41Sopenharmony_ci<li><a href="#ecmascript-modules-loader-entry-point-caveat">ECMAScript modules loader entry point caveat</a></li> 4491cb0ef41Sopenharmony_ci</ul> 4501cb0ef41Sopenharmony_ci</li> 4511cb0ef41Sopenharmony_ci<li><a href="#options">Options</a> 4521cb0ef41Sopenharmony_ci<ul> 4531cb0ef41Sopenharmony_ci<li><a href="#-"><code>-</code></a></li> 4541cb0ef41Sopenharmony_ci<li><a href="#--"><code>--</code></a></li> 4551cb0ef41Sopenharmony_ci<li><a href="#--abort-on-uncaught-exception"><code>--abort-on-uncaught-exception</code></a></li> 4561cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--build-snapshot"><code>--build-snapshot</code></a></span></li> 4571cb0ef41Sopenharmony_ci<li><a href="#--completion-bash"><code>--completion-bash</code></a></li> 4581cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#-c-condition---conditionscondition"><code>-C condition</code>, <code>--conditions=condition</code></a></span></li> 4591cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--cpu-prof"><code>--cpu-prof</code></a></span></li> 4601cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--cpu-prof-dir"><code>--cpu-prof-dir</code></a></span></li> 4611cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--cpu-prof-interval"><code>--cpu-prof-interval</code></a></span></li> 4621cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--cpu-prof-name"><code>--cpu-prof-name</code></a></span></li> 4631cb0ef41Sopenharmony_ci<li><a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir=directory</code></a></li> 4641cb0ef41Sopenharmony_ci<li><a href="#--disable-protomode"><code>--disable-proto=mode</code></a></li> 4651cb0ef41Sopenharmony_ci<li><a href="#--disallow-code-generation-from-strings"><code>--disallow-code-generation-from-strings</code></a></li> 4661cb0ef41Sopenharmony_ci<li><a href="#--dns-result-orderorder"><code>--dns-result-order=order</code></a></li> 4671cb0ef41Sopenharmony_ci<li><a href="#--enable-fips"><code>--enable-fips</code></a></li> 4681cb0ef41Sopenharmony_ci<li><a href="#--enable-network-family-autoselection"><code>--enable-network-family-autoselection</code></a></li> 4691cb0ef41Sopenharmony_ci<li><a href="#--enable-source-maps"><code>--enable-source-maps</code></a></li> 4701cb0ef41Sopenharmony_ci<li><a href="#--experimental-global-customevent"><code>--experimental-global-customevent</code></a></li> 4711cb0ef41Sopenharmony_ci<li><a href="#--experimental-global-webcrypto"><code>--experimental-global-webcrypto</code></a></li> 4721cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--experimental-default-typetype"><code>--experimental-default-type=type</code></a></span></li> 4731cb0ef41Sopenharmony_ci<li><a href="#--experimental-import-meta-resolve"><code>--experimental-import-meta-resolve</code></a></li> 4741cb0ef41Sopenharmony_ci<li><a href="#--experimental-loadermodule"><code>--experimental-loader=module</code></a></li> 4751cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--experimental-network-imports"><code>--experimental-network-imports</code></a></span></li> 4761cb0ef41Sopenharmony_ci<li><a href="#--experimental-policy"><code>--experimental-policy</code></a></li> 4771cb0ef41Sopenharmony_ci<li><a href="#--no-experimental-fetch"><code>--no-experimental-fetch</code></a></li> 4781cb0ef41Sopenharmony_ci<li><a href="#--no-experimental-repl-await"><code>--no-experimental-repl-await</code></a></li> 4791cb0ef41Sopenharmony_ci<li><a href="#--experimental-shadow-realm"><code>--experimental-shadow-realm</code></a></li> 4801cb0ef41Sopenharmony_ci<li><a href="#--experimental-specifier-resolutionmode"><code>--experimental-specifier-resolution=mode</code></a></li> 4811cb0ef41Sopenharmony_ci<li><a href="#--experimental-test-coverage"><code>--experimental-test-coverage</code></a></li> 4821cb0ef41Sopenharmony_ci<li><a href="#--experimental-vm-modules"><code>--experimental-vm-modules</code></a></li> 4831cb0ef41Sopenharmony_ci<li><a href="#--experimental-wasi-unstable-preview1"><code>--experimental-wasi-unstable-preview1</code></a></li> 4841cb0ef41Sopenharmony_ci<li><a href="#--experimental-wasm-modules"><code>--experimental-wasm-modules</code></a></li> 4851cb0ef41Sopenharmony_ci<li><a href="#--force-context-aware"><code>--force-context-aware</code></a></li> 4861cb0ef41Sopenharmony_ci<li><a href="#--force-fips"><code>--force-fips</code></a></li> 4871cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--frozen-intrinsics"><code>--frozen-intrinsics</code></a></span></li> 4881cb0ef41Sopenharmony_ci<li><a href="#--force-node-api-uncaught-exceptions-policy"><code>--force-node-api-uncaught-exceptions-policy</code></a></li> 4891cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heapsnapshot-near-heap-limitmax_count"><code>--heapsnapshot-near-heap-limit=max_count</code></a></span></li> 4901cb0ef41Sopenharmony_ci<li><a href="#--heapsnapshot-signalsignal"><code>--heapsnapshot-signal=signal</code></a></li> 4911cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heap-prof"><code>--heap-prof</code></a></span></li> 4921cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heap-prof-dir"><code>--heap-prof-dir</code></a></span></li> 4931cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heap-prof-interval"><code>--heap-prof-interval</code></a></span></li> 4941cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--heap-prof-name"><code>--heap-prof-name</code></a></span></li> 4951cb0ef41Sopenharmony_ci<li><a href="#--icu-data-dirfile"><code>--icu-data-dir=file</code></a></li> 4961cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--importmodule"><code>--import=module</code></a></span></li> 4971cb0ef41Sopenharmony_ci<li><a href="#--input-typetype"><code>--input-type=type</code></a></li> 4981cb0ef41Sopenharmony_ci<li><a href="#--inspect-brkhostport"><code>--inspect-brk[=[host:]port]</code></a></li> 4991cb0ef41Sopenharmony_ci<li><a href="#--inspect-porthostport"><code>--inspect-port=[host:]port</code></a></li> 5001cb0ef41Sopenharmony_ci<li><a href="#--inspecthostport"><code>--inspect[=[host:]port]</code></a> 5011cb0ef41Sopenharmony_ci<ul> 5021cb0ef41Sopenharmony_ci<li><a href="#warning-binding-inspector-to-a-public-ipport-combination-is-insecure">Warning: binding inspector to a public IP:port combination is insecure</a></li> 5031cb0ef41Sopenharmony_ci</ul> 5041cb0ef41Sopenharmony_ci</li> 5051cb0ef41Sopenharmony_ci<li><a href="#--inspect-publish-uidstderrhttp"><code>--inspect-publish-uid=stderr,http</code></a></li> 5061cb0ef41Sopenharmony_ci<li><a href="#--insecure-http-parser"><code>--insecure-http-parser</code></a></li> 5071cb0ef41Sopenharmony_ci<li><a href="#--jitless"><code>--jitless</code></a></li> 5081cb0ef41Sopenharmony_ci<li><a href="#--max-http-header-sizesize"><code>--max-http-header-size=size</code></a></li> 5091cb0ef41Sopenharmony_ci<li><a href="#--napi-modules"><code>--napi-modules</code></a></li> 5101cb0ef41Sopenharmony_ci<li><a href="#--no-addons"><code>--no-addons</code></a></li> 5111cb0ef41Sopenharmony_ci<li><a href="#--no-deprecation"><code>--no-deprecation</code></a></li> 5121cb0ef41Sopenharmony_ci<li><a href="#--no-extra-info-on-fatal-exception"><code>--no-extra-info-on-fatal-exception</code></a></li> 5131cb0ef41Sopenharmony_ci<li><a href="#--no-force-async-hooks-checks"><code>--no-force-async-hooks-checks</code></a></li> 5141cb0ef41Sopenharmony_ci<li><a href="#--no-global-search-paths"><code>--no-global-search-paths</code></a></li> 5151cb0ef41Sopenharmony_ci<li><a href="#--no-warnings"><code>--no-warnings</code></a></li> 5161cb0ef41Sopenharmony_ci<li><a href="#--node-memory-debug"><code>--node-memory-debug</code></a></li> 5171cb0ef41Sopenharmony_ci<li><a href="#--openssl-configfile"><code>--openssl-config=file</code></a></li> 5181cb0ef41Sopenharmony_ci<li><a href="#--openssl-shared-config"><code>--openssl-shared-config</code></a></li> 5191cb0ef41Sopenharmony_ci<li><a href="#--openssl-legacy-provider"><code>--openssl-legacy-provider</code></a></li> 5201cb0ef41Sopenharmony_ci<li><a href="#--pending-deprecation"><code>--pending-deprecation</code></a></li> 5211cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--policy-integritysri"><code>--policy-integrity=sri</code></a></span></li> 5221cb0ef41Sopenharmony_ci<li><a href="#--preserve-symlinks"><code>--preserve-symlinks</code></a></li> 5231cb0ef41Sopenharmony_ci<li><a href="#--preserve-symlinks-main"><code>--preserve-symlinks-main</code></a></li> 5241cb0ef41Sopenharmony_ci<li><a href="#--prof"><code>--prof</code></a></li> 5251cb0ef41Sopenharmony_ci<li><a href="#--prof-process"><code>--prof-process</code></a></li> 5261cb0ef41Sopenharmony_ci<li><a href="#--redirect-warningsfile"><code>--redirect-warnings=file</code></a></li> 5271cb0ef41Sopenharmony_ci<li><a href="#--report-compact"><code>--report-compact</code></a></li> 5281cb0ef41Sopenharmony_ci<li><a href="#--report-dirdirectory-report-directorydirectory"><code>--report-dir=directory</code>, <code>report-directory=directory</code></a></li> 5291cb0ef41Sopenharmony_ci<li><a href="#--report-filenamefilename"><code>--report-filename=filename</code></a></li> 5301cb0ef41Sopenharmony_ci<li><a href="#--report-on-fatalerror"><code>--report-on-fatalerror</code></a></li> 5311cb0ef41Sopenharmony_ci<li><a href="#--report-on-signal"><code>--report-on-signal</code></a></li> 5321cb0ef41Sopenharmony_ci<li><a href="#--report-signalsignal"><code>--report-signal=signal</code></a></li> 5331cb0ef41Sopenharmony_ci<li><a href="#--report-uncaught-exception"><code>--report-uncaught-exception</code></a></li> 5341cb0ef41Sopenharmony_ci<li><a href="#--secure-heapn"><code>--secure-heap=n</code></a></li> 5351cb0ef41Sopenharmony_ci<li><a href="#--secure-heap-minn"><code>--secure-heap-min=n</code></a></li> 5361cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--snapshot-blobpath"><code>--snapshot-blob=path</code></a></span></li> 5371cb0ef41Sopenharmony_ci<li><a href="#--test"><code>--test</code></a></li> 5381cb0ef41Sopenharmony_ci<li><a href="#--test-concurrency"><code>--test-concurrency</code></a></li> 5391cb0ef41Sopenharmony_ci<li><a href="#--test-name-pattern"><code>--test-name-pattern</code></a></li> 5401cb0ef41Sopenharmony_ci<li><a href="#--test-reporter"><code>--test-reporter</code></a></li> 5411cb0ef41Sopenharmony_ci<li><a href="#--test-reporter-destination"><code>--test-reporter-destination</code></a></li> 5421cb0ef41Sopenharmony_ci<li><a href="#--test-only"><code>--test-only</code></a></li> 5431cb0ef41Sopenharmony_ci<li><a href="#--test-shard"><code>--test-shard</code></a></li> 5441cb0ef41Sopenharmony_ci<li><a href="#--throw-deprecation"><code>--throw-deprecation</code></a></li> 5451cb0ef41Sopenharmony_ci<li><a href="#--titletitle"><code>--title=title</code></a></li> 5461cb0ef41Sopenharmony_ci<li><a href="#--tls-cipher-listlist"><code>--tls-cipher-list=list</code></a></li> 5471cb0ef41Sopenharmony_ci<li><a href="#--tls-keylogfile"><code>--tls-keylog=file</code></a></li> 5481cb0ef41Sopenharmony_ci<li><a href="#--tls-max-v12"><code>--tls-max-v1.2</code></a></li> 5491cb0ef41Sopenharmony_ci<li><a href="#--tls-max-v13"><code>--tls-max-v1.3</code></a></li> 5501cb0ef41Sopenharmony_ci<li><a href="#--tls-min-v10"><code>--tls-min-v1.0</code></a></li> 5511cb0ef41Sopenharmony_ci<li><a href="#--tls-min-v11"><code>--tls-min-v1.1</code></a></li> 5521cb0ef41Sopenharmony_ci<li><a href="#--tls-min-v12"><code>--tls-min-v1.2</code></a></li> 5531cb0ef41Sopenharmony_ci<li><a href="#--tls-min-v13"><code>--tls-min-v1.3</code></a></li> 5541cb0ef41Sopenharmony_ci<li><span class="stability_0"><a href="#--trace-atomics-wait"><code>--trace-atomics-wait</code></a></span></li> 5551cb0ef41Sopenharmony_ci<li><a href="#--trace-deprecation"><code>--trace-deprecation</code></a></li> 5561cb0ef41Sopenharmony_ci<li><a href="#--trace-event-categories"><code>--trace-event-categories</code></a></li> 5571cb0ef41Sopenharmony_ci<li><a href="#--trace-event-file-pattern"><code>--trace-event-file-pattern</code></a></li> 5581cb0ef41Sopenharmony_ci<li><a href="#--trace-events-enabled"><code>--trace-events-enabled</code></a></li> 5591cb0ef41Sopenharmony_ci<li><a href="#--trace-exit"><code>--trace-exit</code></a></li> 5601cb0ef41Sopenharmony_ci<li><a href="#--trace-sigint"><code>--trace-sigint</code></a></li> 5611cb0ef41Sopenharmony_ci<li><a href="#--trace-sync-io"><code>--trace-sync-io</code></a></li> 5621cb0ef41Sopenharmony_ci<li><a href="#--trace-tls"><code>--trace-tls</code></a></li> 5631cb0ef41Sopenharmony_ci<li><a href="#--trace-uncaught"><code>--trace-uncaught</code></a></li> 5641cb0ef41Sopenharmony_ci<li><a href="#--trace-warnings"><code>--trace-warnings</code></a></li> 5651cb0ef41Sopenharmony_ci<li><a href="#--track-heap-objects"><code>--track-heap-objects</code></a></li> 5661cb0ef41Sopenharmony_ci<li><a href="#--unhandled-rejectionsmode"><code>--unhandled-rejections=mode</code></a></li> 5671cb0ef41Sopenharmony_ci<li><a href="#--use-bundled-ca---use-openssl-ca"><code>--use-bundled-ca</code>, <code>--use-openssl-ca</code></a></li> 5681cb0ef41Sopenharmony_ci<li><a href="#--use-largepagesmode"><code>--use-largepages=mode</code></a></li> 5691cb0ef41Sopenharmony_ci<li><a href="#--v8-options"><code>--v8-options</code></a></li> 5701cb0ef41Sopenharmony_ci<li><a href="#--v8-pool-sizenum"><code>--v8-pool-size=num</code></a></li> 5711cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--watch"><code>--watch</code></a></span></li> 5721cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#--watch-path"><code>--watch-path</code></a></span></li> 5731cb0ef41Sopenharmony_ci<li><a href="#--watch-preserve-output"><code>--watch-preserve-output</code></a></li> 5741cb0ef41Sopenharmony_ci<li><a href="#--zero-fill-buffers"><code>--zero-fill-buffers</code></a></li> 5751cb0ef41Sopenharmony_ci<li><a href="#-c---check"><code>-c</code>, <code>--check</code></a></li> 5761cb0ef41Sopenharmony_ci<li><a href="#-e---eval-script"><code>-e</code>, <code>--eval "script"</code></a></li> 5771cb0ef41Sopenharmony_ci<li><a href="#-h---help"><code>-h</code>, <code>--help</code></a></li> 5781cb0ef41Sopenharmony_ci<li><a href="#-i---interactive"><code>-i</code>, <code>--interactive</code></a></li> 5791cb0ef41Sopenharmony_ci<li><a href="#-p---print-script"><code>-p</code>, <code>--print "script"</code></a></li> 5801cb0ef41Sopenharmony_ci<li><a href="#-r---require-module"><code>-r</code>, <code>--require module</code></a></li> 5811cb0ef41Sopenharmony_ci<li><a href="#-v---version"><code>-v</code>, <code>--version</code></a></li> 5821cb0ef41Sopenharmony_ci</ul> 5831cb0ef41Sopenharmony_ci</li> 5841cb0ef41Sopenharmony_ci<li><a href="#environment-variables">Environment variables</a> 5851cb0ef41Sopenharmony_ci<ul> 5861cb0ef41Sopenharmony_ci<li><a href="#force_color1-2-3"><code>FORCE_COLOR=[1, 2, 3]</code></a></li> 5871cb0ef41Sopenharmony_ci<li><a href="#node_debugmodule"><code>NODE_DEBUG=module[,…]</code></a></li> 5881cb0ef41Sopenharmony_ci<li><a href="#node_debug_nativemodule"><code>NODE_DEBUG_NATIVE=module[,…]</code></a></li> 5891cb0ef41Sopenharmony_ci<li><a href="#node_disable_colors1"><code>NODE_DISABLE_COLORS=1</code></a></li> 5901cb0ef41Sopenharmony_ci<li><a href="#node_extra_ca_certsfile"><code>NODE_EXTRA_CA_CERTS=file</code></a></li> 5911cb0ef41Sopenharmony_ci<li><a href="#node_icu_datafile"><code>NODE_ICU_DATA=file</code></a></li> 5921cb0ef41Sopenharmony_ci<li><a href="#node_no_warnings1"><code>NODE_NO_WARNINGS=1</code></a></li> 5931cb0ef41Sopenharmony_ci<li><a href="#node_optionsoptions"><code>NODE_OPTIONS=options...</code></a></li> 5941cb0ef41Sopenharmony_ci<li><a href="#node_pathpath"><code>NODE_PATH=path[:…]</code></a></li> 5951cb0ef41Sopenharmony_ci<li><a href="#node_pending_deprecation1"><code>NODE_PENDING_DEPRECATION=1</code></a></li> 5961cb0ef41Sopenharmony_ci<li><a href="#node_pending_pipe_instancesinstances"><code>NODE_PENDING_PIPE_INSTANCES=instances</code></a></li> 5971cb0ef41Sopenharmony_ci<li><a href="#node_preserve_symlinks1"><code>NODE_PRESERVE_SYMLINKS=1</code></a></li> 5981cb0ef41Sopenharmony_ci<li><a href="#node_redirect_warningsfile"><code>NODE_REDIRECT_WARNINGS=file</code></a></li> 5991cb0ef41Sopenharmony_ci<li><a href="#node_repl_historyfile"><code>NODE_REPL_HISTORY=file</code></a></li> 6001cb0ef41Sopenharmony_ci<li><a href="#node_repl_external_modulefile"><code>NODE_REPL_EXTERNAL_MODULE=file</code></a></li> 6011cb0ef41Sopenharmony_ci<li><a href="#node_skip_platform_checkvalue"><code>NODE_SKIP_PLATFORM_CHECK=value</code></a></li> 6021cb0ef41Sopenharmony_ci<li><a href="#node_test_contextvalue"><code>NODE_TEST_CONTEXT=value</code></a></li> 6031cb0ef41Sopenharmony_ci<li><a href="#node_tls_reject_unauthorizedvalue"><code>NODE_TLS_REJECT_UNAUTHORIZED=value</code></a></li> 6041cb0ef41Sopenharmony_ci<li><a href="#node_v8_coveragedir"><code>NODE_V8_COVERAGE=dir</code></a> 6051cb0ef41Sopenharmony_ci<ul> 6061cb0ef41Sopenharmony_ci<li><a href="#coverage-output">Coverage output</a></li> 6071cb0ef41Sopenharmony_ci<li><span class="stability_1"><a href="#source-map-cache">Source map cache</a></span></li> 6081cb0ef41Sopenharmony_ci</ul> 6091cb0ef41Sopenharmony_ci</li> 6101cb0ef41Sopenharmony_ci<li><a href="#no_colorany"><code>NO_COLOR=<any></code></a></li> 6111cb0ef41Sopenharmony_ci<li><a href="#openssl_conffile"><code>OPENSSL_CONF=file</code></a></li> 6121cb0ef41Sopenharmony_ci<li><a href="#ssl_cert_dirdir"><code>SSL_CERT_DIR=dir</code></a></li> 6131cb0ef41Sopenharmony_ci<li><a href="#ssl_cert_filefile"><code>SSL_CERT_FILE=file</code></a></li> 6141cb0ef41Sopenharmony_ci<li><a href="#tz"><code>TZ</code></a></li> 6151cb0ef41Sopenharmony_ci<li><a href="#uv_threadpool_sizesize"><code>UV_THREADPOOL_SIZE=size</code></a></li> 6161cb0ef41Sopenharmony_ci</ul> 6171cb0ef41Sopenharmony_ci</li> 6181cb0ef41Sopenharmony_ci<li><a href="#useful-v8-options">Useful V8 options</a> 6191cb0ef41Sopenharmony_ci<ul> 6201cb0ef41Sopenharmony_ci<li><a href="#--max-old-space-sizesize-in-megabytes"><code>--max-old-space-size=SIZE</code> (in megabytes)</a></li> 6211cb0ef41Sopenharmony_ci<li><a href="#--max-semi-space-sizesize-in-megabytes"><code>--max-semi-space-size=SIZE</code> (in megabytes)</a></li> 6221cb0ef41Sopenharmony_ci</ul> 6231cb0ef41Sopenharmony_ci</li> 6241cb0ef41Sopenharmony_ci</ul> 6251cb0ef41Sopenharmony_ci</li> 6261cb0ef41Sopenharmony_ci</ul></details> 6271cb0ef41Sopenharmony_ci 6281cb0ef41Sopenharmony_ci <div id="apicontent"> 6291cb0ef41Sopenharmony_ci <h2>Command-line API<span><a class="mark" href="#command-line-api" id="command-line-api">#</a></span><a aria-hidden="true" class="legacy" id="cli_command_line_api"></a></h2> 6301cb0ef41Sopenharmony_ci 6311cb0ef41Sopenharmony_ci 6321cb0ef41Sopenharmony_ci<p>Node.js comes with a variety of CLI options. These options expose built-in 6331cb0ef41Sopenharmony_cidebugging, multiple ways to execute scripts, and other helpful runtime options.</p> 6341cb0ef41Sopenharmony_ci<p>To view this documentation as a manual page in a terminal, run <code>man node</code>.</p> 6351cb0ef41Sopenharmony_ci<section><h3>Synopsis<span><a class="mark" href="#synopsis" id="synopsis">#</a></span><a aria-hidden="true" class="legacy" id="cli_synopsis"></a></h3> 6361cb0ef41Sopenharmony_ci<p><code>node [options] [V8 options] [<program-entry-point> | -e "script" | -] [--] [arguments]</code></p> 6371cb0ef41Sopenharmony_ci<p><code>node inspect [<program-entry-point> | -e "script" | <host>:<port>] …</code></p> 6381cb0ef41Sopenharmony_ci<p><code>node --v8-options</code></p> 6391cb0ef41Sopenharmony_ci<p>Execute without arguments to start the <a href="repl.html">REPL</a>.</p> 6401cb0ef41Sopenharmony_ci<p>For more info about <code>node inspect</code>, see the <a href="debugger.html">debugger</a> documentation.</p> 6411cb0ef41Sopenharmony_ci</section><section><h3>Program entry point<span><a class="mark" href="#program-entry-point" id="program-entry-point">#</a></span><a aria-hidden="true" class="legacy" id="cli_program_entry_point"></a></h3> 6421cb0ef41Sopenharmony_ci<p>The program entry point is a specifier-like string. If the string is not an 6431cb0ef41Sopenharmony_ciabsolute path, it's resolved as a relative path from the current working 6441cb0ef41Sopenharmony_cidirectory. That path is then resolved by <a href="modules.html">CommonJS</a> module loader, or by the 6451cb0ef41Sopenharmony_ci<a href="packages.html#modules-loaders">ES module loader</a> if <a href="#--experimental-default-typetype"><code>--experimental-default-type=module</code></a> 6461cb0ef41Sopenharmony_ciis passed. If no corresponding file is found, an error is thrown.</p> 6471cb0ef41Sopenharmony_ci<p>If a file is found, its path will be passed to the 6481cb0ef41Sopenharmony_ci<a href="packages.html#modules-loaders">ES module loader</a> under any of the following conditions:</p> 6491cb0ef41Sopenharmony_ci<ul> 6501cb0ef41Sopenharmony_ci<li>The program was started with a command-line flag that forces the entry 6511cb0ef41Sopenharmony_cipoint to be loaded with ECMAScript module loader, such as <code>--import</code> or 6521cb0ef41Sopenharmony_ci<a href="#--experimental-default-typetype"><code>--experimental-default-type=module</code></a>.</li> 6531cb0ef41Sopenharmony_ci<li>The file has an <code>.mjs</code> extension.</li> 6541cb0ef41Sopenharmony_ci<li>The file does not have a <code>.cjs</code> extension, and the nearest parent 6551cb0ef41Sopenharmony_ci<code>package.json</code> file contains a top-level <a href="packages.html#type"><code>"type"</code></a> field with a value of 6561cb0ef41Sopenharmony_ci<code>"module"</code>.</li> 6571cb0ef41Sopenharmony_ci</ul> 6581cb0ef41Sopenharmony_ci<p>Otherwise, the file is loaded using the CommonJS module loader. See 6591cb0ef41Sopenharmony_ci<a href="packages.html#modules-loaders">Modules loaders</a> for more details.</p> 6601cb0ef41Sopenharmony_ci<h4>ECMAScript modules loader entry point caveat<span><a class="mark" href="#ecmascript-modules-loader-entry-point-caveat" id="ecmascript-modules-loader-entry-point-caveat">#</a></span><a aria-hidden="true" class="legacy" id="cli_ecmascript_modules_loader_entry_point_caveat"></a></h4> 6611cb0ef41Sopenharmony_ci<p>When loading, the <a href="packages.html#modules-loaders">ES module loader</a> loads the program 6621cb0ef41Sopenharmony_cientry point, the <code>node</code> command will accept as input only files with <code>.js</code>, 6631cb0ef41Sopenharmony_ci<code>.mjs</code>, or <code>.cjs</code> extensions; with <code>.wasm</code> extensions when 6641cb0ef41Sopenharmony_ci<a href="#--experimental-wasm-modules"><code>--experimental-wasm-modules</code></a> is enabled; and with no extension when 6651cb0ef41Sopenharmony_ci<a href="#--experimental-default-typetype"><code>--experimental-default-type=module</code></a> is passed.</p> 6661cb0ef41Sopenharmony_ci</section><section><h3>Options<span><a class="mark" href="#options" id="options">#</a></span><a aria-hidden="true" class="legacy" id="cli_options"></a></h3> 6671cb0ef41Sopenharmony_ci<div class="api_metadata"> 6681cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 6691cb0ef41Sopenharmony_ci<table> 6701cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 6711cb0ef41Sopenharmony_ci<tr><td>v10.12.0</td> 6721cb0ef41Sopenharmony_ci<td><p>Underscores instead of dashes are now allowed for Node.js options as well, in addition to V8 options.</p></td></tr> 6731cb0ef41Sopenharmony_ci</tbody></table> 6741cb0ef41Sopenharmony_ci</details> 6751cb0ef41Sopenharmony_ci</div> 6761cb0ef41Sopenharmony_ci<p>All options, including V8 options, allow words to be separated by both 6771cb0ef41Sopenharmony_cidashes (<code>-</code>) or underscores (<code>_</code>). For example, <code>--pending-deprecation</code> is 6781cb0ef41Sopenharmony_ciequivalent to <code>--pending_deprecation</code>.</p> 6791cb0ef41Sopenharmony_ci<p>If an option that takes a single value (such as <code>--max-http-header-size</code>) is 6801cb0ef41Sopenharmony_cipassed more than once, then the last passed value is used. Options from the 6811cb0ef41Sopenharmony_cicommand line take precedence over options passed through the <a href="#node_optionsoptions"><code>NODE_OPTIONS</code></a> 6821cb0ef41Sopenharmony_cienvironment variable.</p> 6831cb0ef41Sopenharmony_ci<h4><code>-</code><span><a class="mark" href="#-" id="-">#</a></span><a aria-hidden="true" class="legacy" id="cli"></a></h4> 6841cb0ef41Sopenharmony_ci<div class="api_metadata"> 6851cb0ef41Sopenharmony_ci<span>Added in: v8.0.0</span> 6861cb0ef41Sopenharmony_ci</div> 6871cb0ef41Sopenharmony_ci<p>Alias for stdin. Analogous to the use of <code>-</code> in other command-line utilities, 6881cb0ef41Sopenharmony_cimeaning that the script is read from stdin, and the rest of the options 6891cb0ef41Sopenharmony_ciare passed to that script.</p> 6901cb0ef41Sopenharmony_ci<h4><code>--</code><span><a class="mark" href="#--" id="--">#</a></span><a aria-hidden="true" class="legacy" id="cli_1"></a></h4> 6911cb0ef41Sopenharmony_ci<div class="api_metadata"> 6921cb0ef41Sopenharmony_ci<span>Added in: v6.11.0</span> 6931cb0ef41Sopenharmony_ci</div> 6941cb0ef41Sopenharmony_ci<p>Indicate the end of node options. Pass the rest of the arguments to the script. 6951cb0ef41Sopenharmony_ciIf no script filename or eval/print script is supplied prior to this, then 6961cb0ef41Sopenharmony_cithe next argument is used as a script filename.</p> 6971cb0ef41Sopenharmony_ci<h4><code>--abort-on-uncaught-exception</code><span><a class="mark" href="#--abort-on-uncaught-exception" id="--abort-on-uncaught-exception">#</a></span><a aria-hidden="true" class="legacy" id="cli_abort_on_uncaught_exception"></a></h4> 6981cb0ef41Sopenharmony_ci<div class="api_metadata"> 6991cb0ef41Sopenharmony_ci<span>Added in: v0.10.8</span> 7001cb0ef41Sopenharmony_ci</div> 7011cb0ef41Sopenharmony_ci<p>Aborting instead of exiting causes a core file to be generated for post-mortem 7021cb0ef41Sopenharmony_cianalysis using a debugger (such as <code>lldb</code>, <code>gdb</code>, and <code>mdb</code>).</p> 7031cb0ef41Sopenharmony_ci<p>If this flag is passed, the behavior can still be set to not abort through 7041cb0ef41Sopenharmony_ci<a href="process.html#processsetuncaughtexceptioncapturecallbackfn"><code>process.setUncaughtExceptionCaptureCallback()</code></a> (and through usage of the 7051cb0ef41Sopenharmony_ci<code>node:domain</code> module that uses it).</p> 7061cb0ef41Sopenharmony_ci<h4><code>--build-snapshot</code><span><a class="mark" href="#--build-snapshot" id="--build-snapshot">#</a></span><a aria-hidden="true" class="legacy" id="cli_build_snapshot"></a></h4> 7071cb0ef41Sopenharmony_ci<div class="api_metadata"> 7081cb0ef41Sopenharmony_ci<span>Added in: v18.8.0</span> 7091cb0ef41Sopenharmony_ci</div> 7101cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 7111cb0ef41Sopenharmony_ci<p>Generates a snapshot blob when the process exits and writes it to 7121cb0ef41Sopenharmony_cidisk, which can be loaded later with <code>--snapshot-blob</code>.</p> 7131cb0ef41Sopenharmony_ci<p>When building the snapshot, if <code>--snapshot-blob</code> is not specified, 7141cb0ef41Sopenharmony_cithe generated blob will be written, by default, to <code>snapshot.blob</code> 7151cb0ef41Sopenharmony_ciin the current working directory. Otherwise it will be written to 7161cb0ef41Sopenharmony_cithe path specified by <code>--snapshot-blob</code>.</p> 7171cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">"globalThis.foo = 'I am from the snapshot'"</span> > snapshot.js</span> 7181cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_"> 7191cb0ef41Sopenharmony_ci# </span><span class="language-bash">Run snapshot.js to initialize the application and snapshot the</span> 7201cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_"># </span><span class="language-bash">state of it into snapshot.blob.</span> 7211cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash">node --snapshot-blob snapshot.blob --build-snapshot snapshot.js</span> 7221cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_"> 7231cb0ef41Sopenharmony_ci$ </span><span class="language-bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">"console.log(globalThis.foo)"</span> > index.js</span> 7241cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_"> 7251cb0ef41Sopenharmony_ci# </span><span class="language-bash">Load the generated snapshot and start the application from index.js.</span> 7261cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash">node --snapshot-blob snapshot.blob index.js</span> 7271cb0ef41Sopenharmony_ciI am from the snapshot</code> <button class="copy-button">copy</button></pre> 7281cb0ef41Sopenharmony_ci<p>The <a href="v8.html#startup-snapshot-api"><code>v8.startupSnapshot</code> API</a> can be used to specify an entry point at 7291cb0ef41Sopenharmony_cisnapshot building time, thus avoiding the need of an additional entry 7301cb0ef41Sopenharmony_ciscript at deserialization time:</p> 7311cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">"require('v8').startupSnapshot.setDeserializeMainFunction(() => console.log('I am from the snapshot'))"</span> > snapshot.js</span> 7321cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash">node --snapshot-blob snapshot.blob --build-snapshot snapshot.js</span> 7331cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash">node --snapshot-blob snapshot.blob</span> 7341cb0ef41Sopenharmony_ciI am from the snapshot</code> <button class="copy-button">copy</button></pre> 7351cb0ef41Sopenharmony_ci<p>For more information, check out the <a href="v8.html#startup-snapshot-api"><code>v8.startupSnapshot</code> API</a> documentation.</p> 7361cb0ef41Sopenharmony_ci<p>Currently the support for run-time snapshot is experimental in that:</p> 7371cb0ef41Sopenharmony_ci<ol> 7381cb0ef41Sopenharmony_ci<li>User-land modules are not yet supported in the snapshot, so only 7391cb0ef41Sopenharmony_cione single file can be snapshotted. Users can bundle their applications 7401cb0ef41Sopenharmony_ciinto a single script with their bundler of choice before building 7411cb0ef41Sopenharmony_cia snapshot, however.</li> 7421cb0ef41Sopenharmony_ci<li>Only a subset of the built-in modules work in the snapshot, though the 7431cb0ef41Sopenharmony_ciNode.js core test suite checks that a few fairly complex applications 7441cb0ef41Sopenharmony_cican be snapshotted. Support for more modules are being added. If any 7451cb0ef41Sopenharmony_cicrashes or buggy behaviors occur when building a snapshot, please file 7461cb0ef41Sopenharmony_cia report in the <a href="https://github.com/nodejs/node/issues">Node.js issue tracker</a> and link to it in the 7471cb0ef41Sopenharmony_ci<a href="https://github.com/nodejs/node/issues/44014">tracking issue for user-land snapshots</a>.</li> 7481cb0ef41Sopenharmony_ci</ol> 7491cb0ef41Sopenharmony_ci<h4><code>--completion-bash</code><span><a class="mark" href="#--completion-bash" id="--completion-bash">#</a></span><a aria-hidden="true" class="legacy" id="cli_completion_bash"></a></h4> 7501cb0ef41Sopenharmony_ci<div class="api_metadata"> 7511cb0ef41Sopenharmony_ci<span>Added in: v10.12.0</span> 7521cb0ef41Sopenharmony_ci</div> 7531cb0ef41Sopenharmony_ci<p>Print source-able bash completion script for Node.js.</p> 7541cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --completion-bash > node_bash_completion</span> 7551cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">source</span> node_bash_completion</span></code> <button class="copy-button">copy</button></pre> 7561cb0ef41Sopenharmony_ci<h4><code>-C condition</code>, <code>--conditions=condition</code><span><a class="mark" href="#-c-condition---conditionscondition" id="-c-condition---conditionscondition">#</a></span><a aria-hidden="true" class="legacy" id="cli_c_condition_conditions_condition"></a></h4> 7571cb0ef41Sopenharmony_ci<div class="api_metadata"> 7581cb0ef41Sopenharmony_ci<span>Added in: v14.9.0, v12.19.0</span> 7591cb0ef41Sopenharmony_ci</div> 7601cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 7611cb0ef41Sopenharmony_ci<p>Enable experimental support for custom <a href="packages.html#conditional-exports">conditional exports</a> resolution 7621cb0ef41Sopenharmony_ciconditions.</p> 7631cb0ef41Sopenharmony_ci<p>Any number of custom string condition names are permitted.</p> 7641cb0ef41Sopenharmony_ci<p>The default Node.js conditions of <code>"node"</code>, <code>"default"</code>, <code>"import"</code>, and 7651cb0ef41Sopenharmony_ci<code>"require"</code> will always apply as defined.</p> 7661cb0ef41Sopenharmony_ci<p>For example, to run a module with "development" resolutions:</p> 7671cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node -C development app.js</span></code> <button class="copy-button">copy</button></pre> 7681cb0ef41Sopenharmony_ci<h4><code>--cpu-prof</code><span><a class="mark" href="#--cpu-prof" id="--cpu-prof">#</a></span><a aria-hidden="true" class="legacy" id="cli_cpu_prof"></a></h4> 7691cb0ef41Sopenharmony_ci<div class="api_metadata"> 7701cb0ef41Sopenharmony_ci<span>Added in: v12.0.0</span> 7711cb0ef41Sopenharmony_ci</div> 7721cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 7731cb0ef41Sopenharmony_ci<p>Starts the V8 CPU profiler on start up, and writes the CPU profile to disk 7741cb0ef41Sopenharmony_cibefore exit.</p> 7751cb0ef41Sopenharmony_ci<p>If <code>--cpu-prof-dir</code> is not specified, the generated profile is placed 7761cb0ef41Sopenharmony_ciin the current working directory.</p> 7771cb0ef41Sopenharmony_ci<p>If <code>--cpu-prof-name</code> is not specified, the generated profile is 7781cb0ef41Sopenharmony_cinamed <code>CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile</code>.</p> 7791cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --cpu-prof index.js</span> 7801cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">ls</span> *.cpuprofile</span> 7811cb0ef41Sopenharmony_ciCPU.20190409.202950.15293.0.0.cpuprofile</code> <button class="copy-button">copy</button></pre> 7821cb0ef41Sopenharmony_ci<h4><code>--cpu-prof-dir</code><span><a class="mark" href="#--cpu-prof-dir" id="--cpu-prof-dir">#</a></span><a aria-hidden="true" class="legacy" id="cli_cpu_prof_dir"></a></h4> 7831cb0ef41Sopenharmony_ci<div class="api_metadata"> 7841cb0ef41Sopenharmony_ci<span>Added in: v12.0.0</span> 7851cb0ef41Sopenharmony_ci</div> 7861cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 7871cb0ef41Sopenharmony_ci<p>Specify the directory where the CPU profiles generated by <code>--cpu-prof</code> will 7881cb0ef41Sopenharmony_cibe placed.</p> 7891cb0ef41Sopenharmony_ci<p>The default value is controlled by the 7901cb0ef41Sopenharmony_ci<a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir</code></a> command-line option.</p> 7911cb0ef41Sopenharmony_ci<h4><code>--cpu-prof-interval</code><span><a class="mark" href="#--cpu-prof-interval" id="--cpu-prof-interval">#</a></span><a aria-hidden="true" class="legacy" id="cli_cpu_prof_interval"></a></h4> 7921cb0ef41Sopenharmony_ci<div class="api_metadata"> 7931cb0ef41Sopenharmony_ci<span>Added in: v12.2.0</span> 7941cb0ef41Sopenharmony_ci</div> 7951cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 7961cb0ef41Sopenharmony_ci<p>Specify the sampling interval in microseconds for the CPU profiles generated 7971cb0ef41Sopenharmony_ciby <code>--cpu-prof</code>. The default is 1000 microseconds.</p> 7981cb0ef41Sopenharmony_ci<h4><code>--cpu-prof-name</code><span><a class="mark" href="#--cpu-prof-name" id="--cpu-prof-name">#</a></span><a aria-hidden="true" class="legacy" id="cli_cpu_prof_name"></a></h4> 7991cb0ef41Sopenharmony_ci<div class="api_metadata"> 8001cb0ef41Sopenharmony_ci<span>Added in: v12.0.0</span> 8011cb0ef41Sopenharmony_ci</div> 8021cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 8031cb0ef41Sopenharmony_ci<p>Specify the file name of the CPU profile generated by <code>--cpu-prof</code>.</p> 8041cb0ef41Sopenharmony_ci<h4><code>--diagnostic-dir=directory</code><span><a class="mark" href="#--diagnostic-dirdirectory" id="--diagnostic-dirdirectory">#</a></span><a aria-hidden="true" class="legacy" id="cli_diagnostic_dir_directory"></a></h4> 8051cb0ef41Sopenharmony_ci<p>Set the directory to which all diagnostic output files are written. 8061cb0ef41Sopenharmony_ciDefaults to current working directory.</p> 8071cb0ef41Sopenharmony_ci<p>Affects the default output directory of:</p> 8081cb0ef41Sopenharmony_ci<ul> 8091cb0ef41Sopenharmony_ci<li><a href="#--cpu-prof-dir"><code>--cpu-prof-dir</code></a></li> 8101cb0ef41Sopenharmony_ci<li><a href="#--heap-prof-dir"><code>--heap-prof-dir</code></a></li> 8111cb0ef41Sopenharmony_ci<li><a href="#--redirect-warningsfile"><code>--redirect-warnings</code></a></li> 8121cb0ef41Sopenharmony_ci</ul> 8131cb0ef41Sopenharmony_ci<h4><code>--disable-proto=mode</code><span><a class="mark" href="#--disable-protomode" id="--disable-protomode">#</a></span><a aria-hidden="true" class="legacy" id="cli_disable_proto_mode"></a></h4> 8141cb0ef41Sopenharmony_ci<div class="api_metadata"> 8151cb0ef41Sopenharmony_ci<span>Added in: v13.12.0, v12.17.0</span> 8161cb0ef41Sopenharmony_ci</div> 8171cb0ef41Sopenharmony_ci<p>Disable the <code>Object.prototype.__proto__</code> property. If <code>mode</code> is <code>delete</code>, the 8181cb0ef41Sopenharmony_ciproperty is removed entirely. If <code>mode</code> is <code>throw</code>, accesses to the 8191cb0ef41Sopenharmony_ciproperty throw an exception with the code <code>ERR_PROTO_ACCESS</code>.</p> 8201cb0ef41Sopenharmony_ci<h4><code>--disallow-code-generation-from-strings</code><span><a class="mark" href="#--disallow-code-generation-from-strings" id="--disallow-code-generation-from-strings">#</a></span><a aria-hidden="true" class="legacy" id="cli_disallow_code_generation_from_strings"></a></h4> 8211cb0ef41Sopenharmony_ci<div class="api_metadata"> 8221cb0ef41Sopenharmony_ci<span>Added in: v9.8.0</span> 8231cb0ef41Sopenharmony_ci</div> 8241cb0ef41Sopenharmony_ci<p>Make built-in language features like <code>eval</code> and <code>new Function</code> that generate 8251cb0ef41Sopenharmony_cicode from strings throw an exception instead. This does not affect the Node.js 8261cb0ef41Sopenharmony_ci<code>node:vm</code> module.</p> 8271cb0ef41Sopenharmony_ci<h4><code>--dns-result-order=order</code><span><a class="mark" href="#--dns-result-orderorder" id="--dns-result-orderorder">#</a></span><a aria-hidden="true" class="legacy" id="cli_dns_result_order_order"></a></h4> 8281cb0ef41Sopenharmony_ci<div class="api_metadata"> 8291cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 8301cb0ef41Sopenharmony_ci<table> 8311cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 8321cb0ef41Sopenharmony_ci<tr><td>v17.0.0</td> 8331cb0ef41Sopenharmony_ci<td><p>Changed default value to <code>verbatim</code>.</p></td></tr> 8341cb0ef41Sopenharmony_ci<tr><td>v16.4.0, v14.18.0</td> 8351cb0ef41Sopenharmony_ci<td><p><span>Added in: v16.4.0, v14.18.0</span></p></td></tr> 8361cb0ef41Sopenharmony_ci</tbody></table> 8371cb0ef41Sopenharmony_ci</details> 8381cb0ef41Sopenharmony_ci</div> 8391cb0ef41Sopenharmony_ci<p>Set the default value of <code>verbatim</code> in <a href="dns.html#dnslookuphostname-options-callback"><code>dns.lookup()</code></a> and 8401cb0ef41Sopenharmony_ci<a href="dns.html#dnspromiseslookuphostname-options"><code>dnsPromises.lookup()</code></a>. The value could be:</p> 8411cb0ef41Sopenharmony_ci<ul> 8421cb0ef41Sopenharmony_ci<li><code>ipv4first</code>: sets default <code>verbatim</code> <code>false</code>.</li> 8431cb0ef41Sopenharmony_ci<li><code>verbatim</code>: sets default <code>verbatim</code> <code>true</code>.</li> 8441cb0ef41Sopenharmony_ci</ul> 8451cb0ef41Sopenharmony_ci<p>The default is <code>verbatim</code> and <a href="dns.html#dnssetdefaultresultorderorder"><code>dns.setDefaultResultOrder()</code></a> have higher 8461cb0ef41Sopenharmony_cipriority than <code>--dns-result-order</code>.</p> 8471cb0ef41Sopenharmony_ci<h4><code>--enable-fips</code><span><a class="mark" href="#--enable-fips" id="--enable-fips">#</a></span><a aria-hidden="true" class="legacy" id="cli_enable_fips"></a></h4> 8481cb0ef41Sopenharmony_ci<div class="api_metadata"> 8491cb0ef41Sopenharmony_ci<span>Added in: v6.0.0</span> 8501cb0ef41Sopenharmony_ci</div> 8511cb0ef41Sopenharmony_ci<p>Enable FIPS-compliant crypto at startup. (Requires Node.js to be built 8521cb0ef41Sopenharmony_ciagainst FIPS-compatible OpenSSL.)</p> 8531cb0ef41Sopenharmony_ci<h4><code>--enable-network-family-autoselection</code><span><a class="mark" href="#--enable-network-family-autoselection" id="--enable-network-family-autoselection">#</a></span><a aria-hidden="true" class="legacy" id="cli_enable_network_family_autoselection"></a></h4> 8541cb0ef41Sopenharmony_ci<div class="api_metadata"> 8551cb0ef41Sopenharmony_ci<span>Added in: v18.18.0</span> 8561cb0ef41Sopenharmony_ci</div> 8571cb0ef41Sopenharmony_ci<p>Enables the family autoselection algorithm unless connection options explicitly 8581cb0ef41Sopenharmony_cidisables it.</p> 8591cb0ef41Sopenharmony_ci<h4><code>--enable-source-maps</code><span><a class="mark" href="#--enable-source-maps" id="--enable-source-maps">#</a></span><a aria-hidden="true" class="legacy" id="cli_enable_source_maps"></a></h4> 8601cb0ef41Sopenharmony_ci<div class="api_metadata"> 8611cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 8621cb0ef41Sopenharmony_ci<table> 8631cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 8641cb0ef41Sopenharmony_ci<tr><td>v15.11.0, v14.18.0</td> 8651cb0ef41Sopenharmony_ci<td><p>This API is no longer experimental.</p></td></tr> 8661cb0ef41Sopenharmony_ci<tr><td>v12.12.0</td> 8671cb0ef41Sopenharmony_ci<td><p><span>Added in: v12.12.0</span></p></td></tr> 8681cb0ef41Sopenharmony_ci</tbody></table> 8691cb0ef41Sopenharmony_ci</details> 8701cb0ef41Sopenharmony_ci</div> 8711cb0ef41Sopenharmony_ci<p>Enable <a href="https://sourcemaps.info/spec.html">Source Map v3</a> support for stack traces.</p> 8721cb0ef41Sopenharmony_ci<p>When using a transpiler, such as TypeScript, stack traces thrown by an 8731cb0ef41Sopenharmony_ciapplication reference the transpiled code, not the original source position. 8741cb0ef41Sopenharmony_ci<code>--enable-source-maps</code> enables caching of Source Maps and makes a best 8751cb0ef41Sopenharmony_cieffort to report stack traces relative to the original source file.</p> 8761cb0ef41Sopenharmony_ci<p>Overriding <code>Error.prepareStackTrace</code> prevents <code>--enable-source-maps</code> from 8771cb0ef41Sopenharmony_cimodifying the stack trace.</p> 8781cb0ef41Sopenharmony_ci<p>Note, enabling source maps can introduce latency to your application 8791cb0ef41Sopenharmony_ciwhen <code>Error.stack</code> is accessed. If you access <code>Error.stack</code> frequently 8801cb0ef41Sopenharmony_ciin your application, take into account the performance implications 8811cb0ef41Sopenharmony_ciof <code>--enable-source-maps</code>.</p> 8821cb0ef41Sopenharmony_ci<h4><code>--experimental-global-customevent</code><span><a class="mark" href="#--experimental-global-customevent" id="--experimental-global-customevent">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_global_customevent"></a></h4> 8831cb0ef41Sopenharmony_ci<div class="api_metadata"> 8841cb0ef41Sopenharmony_ci<span>Added in: v18.7.0</span> 8851cb0ef41Sopenharmony_ci</div> 8861cb0ef41Sopenharmony_ci<p>Expose the <a href="https://dom.spec.whatwg.org/#customevent">CustomEvent Web API</a> on the global scope.</p> 8871cb0ef41Sopenharmony_ci<h4><code>--experimental-global-webcrypto</code><span><a class="mark" href="#--experimental-global-webcrypto" id="--experimental-global-webcrypto">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_global_webcrypto"></a></h4> 8881cb0ef41Sopenharmony_ci<div class="api_metadata"> 8891cb0ef41Sopenharmony_ci<span>Added in: v17.6.0</span> 8901cb0ef41Sopenharmony_ci</div> 8911cb0ef41Sopenharmony_ci<p>Expose the <a href="webcrypto.html">Web Crypto API</a> on the global scope.</p> 8921cb0ef41Sopenharmony_ci<h4><code>--experimental-default-type=type</code><span><a class="mark" href="#--experimental-default-typetype" id="--experimental-default-typetype">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_default_type_type"></a></h4> 8931cb0ef41Sopenharmony_ci<div class="api_metadata"> 8941cb0ef41Sopenharmony_ci<span>Added in: v18.19.0</span> 8951cb0ef41Sopenharmony_ci</div> 8961cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a>.0 - Early development</div><p></p> 8971cb0ef41Sopenharmony_ci<p>Define which module system, <code>module</code> or <code>commonjs</code>, to use for the following:</p> 8981cb0ef41Sopenharmony_ci<ul> 8991cb0ef41Sopenharmony_ci<li> 9001cb0ef41Sopenharmony_ci<p>String input provided via <code>--eval</code> or STDIN, if <code>--input-type</code> is unspecified.</p> 9011cb0ef41Sopenharmony_ci</li> 9021cb0ef41Sopenharmony_ci<li> 9031cb0ef41Sopenharmony_ci<p>Files ending in <code>.js</code> or with no extension, if there is no <code>package.json</code> file 9041cb0ef41Sopenharmony_cipresent in the same folder or any parent folder.</p> 9051cb0ef41Sopenharmony_ci</li> 9061cb0ef41Sopenharmony_ci<li> 9071cb0ef41Sopenharmony_ci<p>Files ending in <code>.js</code> or with no extension, if the nearest parent 9081cb0ef41Sopenharmony_ci<code>package.json</code> field lacks a <code>"type"</code> field; unless the <code>package.json</code> folder 9091cb0ef41Sopenharmony_cior any parent folder is inside a <code>node_modules</code> folder.</p> 9101cb0ef41Sopenharmony_ci</li> 9111cb0ef41Sopenharmony_ci</ul> 9121cb0ef41Sopenharmony_ci<p>In other words, <code>--experimental-default-type=module</code> flips all the places where 9131cb0ef41Sopenharmony_ciNode.js currently defaults to CommonJS to instead default to ECMAScript modules, 9141cb0ef41Sopenharmony_ciwith the exception of folders and subfolders below <code>node_modules</code>, for backward 9151cb0ef41Sopenharmony_cicompatibility.</p> 9161cb0ef41Sopenharmony_ci<p>Under <code>--experimental-default-type=module</code> and <code>--experimental-wasm-modules</code>, 9171cb0ef41Sopenharmony_cifiles with no extension will be treated as WebAssembly if they begin with the 9181cb0ef41Sopenharmony_ciWebAssembly magic number (<code>\0asm</code>); otherwise they will be treated as ES module 9191cb0ef41Sopenharmony_ciJavaScript.</p> 9201cb0ef41Sopenharmony_ci<h4><code>--experimental-import-meta-resolve</code><span><a class="mark" href="#--experimental-import-meta-resolve" id="--experimental-import-meta-resolve">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_import_meta_resolve"></a></h4> 9211cb0ef41Sopenharmony_ci<div class="api_metadata"> 9221cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 9231cb0ef41Sopenharmony_ci<table> 9241cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 9251cb0ef41Sopenharmony_ci<tr><td>v18.19.0</td> 9261cb0ef41Sopenharmony_ci<td><p>synchronous import.meta.resolve made available by default, with the flag retained for enabling the experimental second argument as previously supported.</p></td></tr> 9271cb0ef41Sopenharmony_ci<tr><td>v13.9.0, v12.16.2</td> 9281cb0ef41Sopenharmony_ci<td><p><span>Added in: v13.9.0, v12.16.2</span></p></td></tr> 9291cb0ef41Sopenharmony_ci</tbody></table> 9301cb0ef41Sopenharmony_ci</details> 9311cb0ef41Sopenharmony_ci</div> 9321cb0ef41Sopenharmony_ci<p>Enable experimental <code>import.meta.resolve()</code> parent URL support, which allows 9331cb0ef41Sopenharmony_cipassing a second <code>parentURL</code> argument for contextual resolution.</p> 9341cb0ef41Sopenharmony_ci<p>Previously gated the entire <code>import.meta.resolve</code> feature.</p> 9351cb0ef41Sopenharmony_ci<h4><code>--experimental-loader=module</code><span><a class="mark" href="#--experimental-loadermodule" id="--experimental-loadermodule">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_loader_module"></a></h4> 9361cb0ef41Sopenharmony_ci<div class="api_metadata"> 9371cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 9381cb0ef41Sopenharmony_ci<table> 9391cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 9401cb0ef41Sopenharmony_ci<tr><td>v12.11.1</td> 9411cb0ef41Sopenharmony_ci<td><p>This flag was renamed from <code>--loader</code> to <code>--experimental-loader</code>.</p></td></tr> 9421cb0ef41Sopenharmony_ci<tr><td>v8.8.0</td> 9431cb0ef41Sopenharmony_ci<td><p><span>Added in: v8.8.0</span></p></td></tr> 9441cb0ef41Sopenharmony_ci</tbody></table> 9451cb0ef41Sopenharmony_ci</details> 9461cb0ef41Sopenharmony_ci</div> 9471cb0ef41Sopenharmony_ci<blockquote> 9481cb0ef41Sopenharmony_ci<p>This flag is discouraged and may be removed in a future version of Node.js. 9491cb0ef41Sopenharmony_ciPlease use 9501cb0ef41Sopenharmony_ci<a href="module.html#enabling"><code>--import</code> with <code>register()</code></a> instead.</p> 9511cb0ef41Sopenharmony_ci</blockquote> 9521cb0ef41Sopenharmony_ci<p>Specify the <code>module</code> containing exported <a href="module.html#customization-hooks">module customization hooks</a>. 9531cb0ef41Sopenharmony_ci<code>module</code> may be any string accepted as an <a href="esm.html#import-specifiers"><code>import</code> specifier</a>.</p> 9541cb0ef41Sopenharmony_ci<h4><code>--experimental-network-imports</code><span><a class="mark" href="#--experimental-network-imports" id="--experimental-network-imports">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_network_imports"></a></h4> 9551cb0ef41Sopenharmony_ci<div class="api_metadata"> 9561cb0ef41Sopenharmony_ci<span>Added in: v17.6.0</span> 9571cb0ef41Sopenharmony_ci</div> 9581cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 9591cb0ef41Sopenharmony_ci<p>Enable experimental support for the <code>https:</code> protocol in <code>import</code> specifiers.</p> 9601cb0ef41Sopenharmony_ci<h4><code>--experimental-policy</code><span><a class="mark" href="#--experimental-policy" id="--experimental-policy">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_policy"></a></h4> 9611cb0ef41Sopenharmony_ci<div class="api_metadata"> 9621cb0ef41Sopenharmony_ci<span>Added in: v11.8.0</span> 9631cb0ef41Sopenharmony_ci</div> 9641cb0ef41Sopenharmony_ci<p>Use the specified file as a security policy.</p> 9651cb0ef41Sopenharmony_ci<h4><code>--no-experimental-fetch</code><span><a class="mark" href="#--no-experimental-fetch" id="--no-experimental-fetch">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_experimental_fetch"></a></h4> 9661cb0ef41Sopenharmony_ci<div class="api_metadata"> 9671cb0ef41Sopenharmony_ci<span>Added in: v18.0.0</span> 9681cb0ef41Sopenharmony_ci</div> 9691cb0ef41Sopenharmony_ci<p>Disable experimental support for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">Fetch API</a>.</p> 9701cb0ef41Sopenharmony_ci<h4><code>--no-experimental-repl-await</code><span><a class="mark" href="#--no-experimental-repl-await" id="--no-experimental-repl-await">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_experimental_repl_await"></a></h4> 9711cb0ef41Sopenharmony_ci<div class="api_metadata"> 9721cb0ef41Sopenharmony_ci<span>Added in: v16.6.0</span> 9731cb0ef41Sopenharmony_ci</div> 9741cb0ef41Sopenharmony_ci<p>Use this flag to disable top-level await in REPL.</p> 9751cb0ef41Sopenharmony_ci<h4><code>--experimental-shadow-realm</code><span><a class="mark" href="#--experimental-shadow-realm" id="--experimental-shadow-realm">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_shadow_realm"></a></h4> 9761cb0ef41Sopenharmony_ci<div class="api_metadata"> 9771cb0ef41Sopenharmony_ci<span>Added in: v18.13.0</span> 9781cb0ef41Sopenharmony_ci</div> 9791cb0ef41Sopenharmony_ci<p>Use this flag to enable <a href="https://github.com/tc39/proposal-shadowrealm">ShadowRealm</a> support.</p> 9801cb0ef41Sopenharmony_ci<h4><code>--experimental-specifier-resolution=mode</code><span><a class="mark" href="#--experimental-specifier-resolutionmode" id="--experimental-specifier-resolutionmode">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_specifier_resolution_mode"></a></h4> 9811cb0ef41Sopenharmony_ci<div class="api_metadata"> 9821cb0ef41Sopenharmony_ci<span>Added in: v13.4.0, v12.16.0</span> 9831cb0ef41Sopenharmony_ci</div> 9841cb0ef41Sopenharmony_ci<p>Sets the resolution algorithm for resolving ES module specifiers. Valid options 9851cb0ef41Sopenharmony_ciare <code>explicit</code> and <code>node</code>.</p> 9861cb0ef41Sopenharmony_ci<p>The default is <code>explicit</code>, which requires providing the full path to a 9871cb0ef41Sopenharmony_cimodule. The <code>node</code> mode enables support for optional file extensions and 9881cb0ef41Sopenharmony_cithe ability to import a directory that has an index file.</p> 9891cb0ef41Sopenharmony_ci<p>See <a href="esm.html#customizing-esm-specifier-resolution-algorithm">customizing ESM specifier resolution</a> for example usage.</p> 9901cb0ef41Sopenharmony_ci<h4><code>--experimental-test-coverage</code><span><a class="mark" href="#--experimental-test-coverage" id="--experimental-test-coverage">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_test_coverage"></a></h4> 9911cb0ef41Sopenharmony_ci<div class="api_metadata"> 9921cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 9931cb0ef41Sopenharmony_ci<table> 9941cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 9951cb0ef41Sopenharmony_ci<tr><td>v18.17.0</td> 9961cb0ef41Sopenharmony_ci<td><p>This option can be used with <code>--test</code>.</p></td></tr> 9971cb0ef41Sopenharmony_ci<tr><td>v18.15.0</td> 9981cb0ef41Sopenharmony_ci<td><p><span>Added in: v18.15.0</span></p></td></tr> 9991cb0ef41Sopenharmony_ci</tbody></table> 10001cb0ef41Sopenharmony_ci</details> 10011cb0ef41Sopenharmony_ci</div> 10021cb0ef41Sopenharmony_ci<p>When used in conjunction with the <code>node:test</code> module, a code coverage report is 10031cb0ef41Sopenharmony_cigenerated as part of the test runner output. If no tests are run, a coverage 10041cb0ef41Sopenharmony_cireport is not generated. See the documentation on 10051cb0ef41Sopenharmony_ci<a href="test.html#collecting-code-coverage">collecting code coverage from tests</a> for more details.</p> 10061cb0ef41Sopenharmony_ci<h4><code>--experimental-vm-modules</code><span><a class="mark" href="#--experimental-vm-modules" id="--experimental-vm-modules">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_vm_modules"></a></h4> 10071cb0ef41Sopenharmony_ci<div class="api_metadata"> 10081cb0ef41Sopenharmony_ci<span>Added in: v9.6.0</span> 10091cb0ef41Sopenharmony_ci</div> 10101cb0ef41Sopenharmony_ci<p>Enable experimental ES Module support in the <code>node:vm</code> module.</p> 10111cb0ef41Sopenharmony_ci<h4><code>--experimental-wasi-unstable-preview1</code><span><a class="mark" href="#--experimental-wasi-unstable-preview1" id="--experimental-wasi-unstable-preview1">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_wasi_unstable_preview1"></a></h4> 10121cb0ef41Sopenharmony_ci<div class="api_metadata"> 10131cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 10141cb0ef41Sopenharmony_ci<table> 10151cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 10161cb0ef41Sopenharmony_ci<tr><td>v18.17.0</td> 10171cb0ef41Sopenharmony_ci<td><p>This option is no longer required as WASI is enabled by default, but can still be passed.</p></td></tr> 10181cb0ef41Sopenharmony_ci<tr><td>v13.6.0</td> 10191cb0ef41Sopenharmony_ci<td><p>changed from <code>--experimental-wasi-unstable-preview0</code> to <code>--experimental-wasi-unstable-preview1</code>.</p></td></tr> 10201cb0ef41Sopenharmony_ci<tr><td>v13.3.0, v12.16.0</td> 10211cb0ef41Sopenharmony_ci<td><p><span>Added in: v13.3.0, v12.16.0</span></p></td></tr> 10221cb0ef41Sopenharmony_ci</tbody></table> 10231cb0ef41Sopenharmony_ci</details> 10241cb0ef41Sopenharmony_ci</div> 10251cb0ef41Sopenharmony_ci<p>Enable experimental WebAssembly System Interface (WASI) support.</p> 10261cb0ef41Sopenharmony_ci<h4><code>--experimental-wasm-modules</code><span><a class="mark" href="#--experimental-wasm-modules" id="--experimental-wasm-modules">#</a></span><a aria-hidden="true" class="legacy" id="cli_experimental_wasm_modules"></a></h4> 10271cb0ef41Sopenharmony_ci<div class="api_metadata"> 10281cb0ef41Sopenharmony_ci<span>Added in: v12.3.0</span> 10291cb0ef41Sopenharmony_ci</div> 10301cb0ef41Sopenharmony_ci<p>Enable experimental WebAssembly module support.</p> 10311cb0ef41Sopenharmony_ci<h4><code>--force-context-aware</code><span><a class="mark" href="#--force-context-aware" id="--force-context-aware">#</a></span><a aria-hidden="true" class="legacy" id="cli_force_context_aware"></a></h4> 10321cb0ef41Sopenharmony_ci<div class="api_metadata"> 10331cb0ef41Sopenharmony_ci<span>Added in: v12.12.0</span> 10341cb0ef41Sopenharmony_ci</div> 10351cb0ef41Sopenharmony_ci<p>Disable loading native addons that are not <a href="addons.html#context-aware-addons">context-aware</a>.</p> 10361cb0ef41Sopenharmony_ci<h4><code>--force-fips</code><span><a class="mark" href="#--force-fips" id="--force-fips">#</a></span><a aria-hidden="true" class="legacy" id="cli_force_fips"></a></h4> 10371cb0ef41Sopenharmony_ci<div class="api_metadata"> 10381cb0ef41Sopenharmony_ci<span>Added in: v6.0.0</span> 10391cb0ef41Sopenharmony_ci</div> 10401cb0ef41Sopenharmony_ci<p>Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.) 10411cb0ef41Sopenharmony_ci(Same requirements as <code>--enable-fips</code>.)</p> 10421cb0ef41Sopenharmony_ci<h4><code>--frozen-intrinsics</code><span><a class="mark" href="#--frozen-intrinsics" id="--frozen-intrinsics">#</a></span><a aria-hidden="true" class="legacy" id="cli_frozen_intrinsics"></a></h4> 10431cb0ef41Sopenharmony_ci<div class="api_metadata"> 10441cb0ef41Sopenharmony_ci<span>Added in: v11.12.0</span> 10451cb0ef41Sopenharmony_ci</div> 10461cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 10471cb0ef41Sopenharmony_ci<p>Enable experimental frozen intrinsics like <code>Array</code> and <code>Object</code>.</p> 10481cb0ef41Sopenharmony_ci<p>Only the root context is supported. There is no guarantee that 10491cb0ef41Sopenharmony_ci<code>globalThis.Array</code> is indeed the default intrinsic reference. Code may break 10501cb0ef41Sopenharmony_ciunder this flag.</p> 10511cb0ef41Sopenharmony_ci<p>To allow polyfills to be added, 10521cb0ef41Sopenharmony_ci<a href="#-r---require-module"><code>--require</code></a> and <a href="#--importmodule"><code>--import</code></a> both run before freezing intrinsics.</p> 10531cb0ef41Sopenharmony_ci<h4><code>--force-node-api-uncaught-exceptions-policy</code><span><a class="mark" href="#--force-node-api-uncaught-exceptions-policy" id="--force-node-api-uncaught-exceptions-policy">#</a></span><a aria-hidden="true" class="legacy" id="cli_force_node_api_uncaught_exceptions_policy"></a></h4> 10541cb0ef41Sopenharmony_ci<div class="api_metadata"> 10551cb0ef41Sopenharmony_ci<span>Added in: v18.3.0</span> 10561cb0ef41Sopenharmony_ci</div> 10571cb0ef41Sopenharmony_ci<p>Enforces <code>uncaughtException</code> event on Node-API asynchronous callbacks.</p> 10581cb0ef41Sopenharmony_ci<p>To prevent from an existing add-on from crashing the process, this flag is not 10591cb0ef41Sopenharmony_cienabled by default. In the future, this flag will be enabled by default to 10601cb0ef41Sopenharmony_cienforce the correct behavior.</p> 10611cb0ef41Sopenharmony_ci<h4><code>--heapsnapshot-near-heap-limit=max_count</code><span><a class="mark" href="#--heapsnapshot-near-heap-limitmax_count" id="--heapsnapshot-near-heap-limitmax_count">#</a></span><a aria-hidden="true" class="legacy" id="cli_heapsnapshot_near_heap_limit_max_count"></a></h4> 10621cb0ef41Sopenharmony_ci<div class="api_metadata"> 10631cb0ef41Sopenharmony_ci<span>Added in: v15.1.0, v14.18.0</span> 10641cb0ef41Sopenharmony_ci</div> 10651cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 10661cb0ef41Sopenharmony_ci<p>Writes a V8 heap snapshot to disk when the V8 heap usage is approaching the 10671cb0ef41Sopenharmony_ciheap limit. <code>count</code> should be a non-negative integer (in which case 10681cb0ef41Sopenharmony_ciNode.js will write no more than <code>max_count</code> snapshots to disk).</p> 10691cb0ef41Sopenharmony_ci<p>When generating snapshots, garbage collection may be triggered and bring 10701cb0ef41Sopenharmony_cithe heap usage down. Therefore multiple snapshots may be written to disk 10711cb0ef41Sopenharmony_cibefore the Node.js instance finally runs out of memory. These heap snapshots 10721cb0ef41Sopenharmony_cican be compared to determine what objects are being allocated during the 10731cb0ef41Sopenharmony_citime consecutive snapshots are taken. It's not guaranteed that Node.js will 10741cb0ef41Sopenharmony_ciwrite exactly <code>max_count</code> snapshots to disk, but it will try 10751cb0ef41Sopenharmony_ciits best to generate at least one and up to <code>max_count</code> snapshots before the 10761cb0ef41Sopenharmony_ciNode.js instance runs out of memory when <code>max_count</code> is greater than <code>0</code>.</p> 10771cb0ef41Sopenharmony_ci<p>Generating V8 snapshots takes time and memory (both memory managed by the 10781cb0ef41Sopenharmony_ciV8 heap and native memory outside the V8 heap). The bigger the heap is, 10791cb0ef41Sopenharmony_cithe more resources it needs. Node.js will adjust the V8 heap to accommodate 10801cb0ef41Sopenharmony_cithe additional V8 heap memory overhead, and try its best to avoid using up 10811cb0ef41Sopenharmony_ciall the memory available to the process. When the process uses 10821cb0ef41Sopenharmony_cimore memory than the system deems appropriate, the process may be terminated 10831cb0ef41Sopenharmony_ciabruptly by the system, depending on the system configuration.</p> 10841cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --max-old-space-size=100 --heapsnapshot-near-heap-limit=3 index.js</span> 10851cb0ef41Sopenharmony_ciWrote snapshot to Heap.20200430.100036.49580.0.001.heapsnapshot 10861cb0ef41Sopenharmony_ciWrote snapshot to Heap.20200430.100037.49580.0.002.heapsnapshot 10871cb0ef41Sopenharmony_ciWrote snapshot to Heap.20200430.100038.49580.0.003.heapsnapshot 10881cb0ef41Sopenharmony_ci 10891cb0ef41Sopenharmony_ci<--- Last few GCs ---> 10901cb0ef41Sopenharmony_ci 10911cb0ef41Sopenharmony_ci[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 10921cb0ef41Sopenharmony_ci[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 10931cb0ef41Sopenharmony_ci 10941cb0ef41Sopenharmony_ci 10951cb0ef41Sopenharmony_ci<--- JS stacktrace ---> 10961cb0ef41Sopenharmony_ci 10971cb0ef41Sopenharmony_ciFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 10981cb0ef41Sopenharmony_ci....</code> <button class="copy-button">copy</button></pre> 10991cb0ef41Sopenharmony_ci<h4><code>--heapsnapshot-signal=signal</code><span><a class="mark" href="#--heapsnapshot-signalsignal" id="--heapsnapshot-signalsignal">#</a></span><a aria-hidden="true" class="legacy" id="cli_heapsnapshot_signal_signal"></a></h4> 11001cb0ef41Sopenharmony_ci<div class="api_metadata"> 11011cb0ef41Sopenharmony_ci<span>Added in: v12.0.0</span> 11021cb0ef41Sopenharmony_ci</div> 11031cb0ef41Sopenharmony_ci<p>Enables a signal handler that causes the Node.js process to write a heap dump 11041cb0ef41Sopenharmony_ciwhen the specified signal is received. <code>signal</code> must be a valid signal name. 11051cb0ef41Sopenharmony_ciDisabled by default.</p> 11061cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --heapsnapshot-signal=SIGUSR2 index.js &</span> 11071cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash">ps aux</span> 11081cb0ef41Sopenharmony_ciUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND 11091cb0ef41Sopenharmony_cinode 1 5.5 6.1 787252 247004 ? Ssl 16:43 0:02 node --heapsnapshot-signal=SIGUSR2 index.js 11101cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">kill</span> -USR2 1</span> 11111cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">ls</span></span> 11121cb0ef41Sopenharmony_ciHeap.20190718.133405.15554.0.001.heapsnapshot</code> <button class="copy-button">copy</button></pre> 11131cb0ef41Sopenharmony_ci<h4><code>--heap-prof</code><span><a class="mark" href="#--heap-prof" id="--heap-prof">#</a></span><a aria-hidden="true" class="legacy" id="cli_heap_prof"></a></h4> 11141cb0ef41Sopenharmony_ci<div class="api_metadata"> 11151cb0ef41Sopenharmony_ci<span>Added in: v12.4.0</span> 11161cb0ef41Sopenharmony_ci</div> 11171cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 11181cb0ef41Sopenharmony_ci<p>Starts the V8 heap profiler on start up, and writes the heap profile to disk 11191cb0ef41Sopenharmony_cibefore exit.</p> 11201cb0ef41Sopenharmony_ci<p>If <code>--heap-prof-dir</code> is not specified, the generated profile is placed 11211cb0ef41Sopenharmony_ciin the current working directory.</p> 11221cb0ef41Sopenharmony_ci<p>If <code>--heap-prof-name</code> is not specified, the generated profile is 11231cb0ef41Sopenharmony_cinamed <code>Heap.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.heapprofile</code>.</p> 11241cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --heap-prof index.js</span> 11251cb0ef41Sopenharmony_ci<span class="hljs-meta prompt_">$ </span><span class="language-bash"><span class="hljs-built_in">ls</span> *.heapprofile</span> 11261cb0ef41Sopenharmony_ciHeap.20190409.202950.15293.0.001.heapprofile</code> <button class="copy-button">copy</button></pre> 11271cb0ef41Sopenharmony_ci<h4><code>--heap-prof-dir</code><span><a class="mark" href="#--heap-prof-dir" id="--heap-prof-dir">#</a></span><a aria-hidden="true" class="legacy" id="cli_heap_prof_dir"></a></h4> 11281cb0ef41Sopenharmony_ci<div class="api_metadata"> 11291cb0ef41Sopenharmony_ci<span>Added in: v12.4.0</span> 11301cb0ef41Sopenharmony_ci</div> 11311cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 11321cb0ef41Sopenharmony_ci<p>Specify the directory where the heap profiles generated by <code>--heap-prof</code> will 11331cb0ef41Sopenharmony_cibe placed.</p> 11341cb0ef41Sopenharmony_ci<p>The default value is controlled by the 11351cb0ef41Sopenharmony_ci<a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir</code></a> command-line option.</p> 11361cb0ef41Sopenharmony_ci<h4><code>--heap-prof-interval</code><span><a class="mark" href="#--heap-prof-interval" id="--heap-prof-interval">#</a></span><a aria-hidden="true" class="legacy" id="cli_heap_prof_interval"></a></h4> 11371cb0ef41Sopenharmony_ci<div class="api_metadata"> 11381cb0ef41Sopenharmony_ci<span>Added in: v12.4.0</span> 11391cb0ef41Sopenharmony_ci</div> 11401cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 11411cb0ef41Sopenharmony_ci<p>Specify the average sampling interval in bytes for the heap profiles generated 11421cb0ef41Sopenharmony_ciby <code>--heap-prof</code>. The default is 512 * 1024 bytes.</p> 11431cb0ef41Sopenharmony_ci<h4><code>--heap-prof-name</code><span><a class="mark" href="#--heap-prof-name" id="--heap-prof-name">#</a></span><a aria-hidden="true" class="legacy" id="cli_heap_prof_name"></a></h4> 11441cb0ef41Sopenharmony_ci<div class="api_metadata"> 11451cb0ef41Sopenharmony_ci<span>Added in: v12.4.0</span> 11461cb0ef41Sopenharmony_ci</div> 11471cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 11481cb0ef41Sopenharmony_ci<p>Specify the file name of the heap profile generated by <code>--heap-prof</code>.</p> 11491cb0ef41Sopenharmony_ci<h4><code>--icu-data-dir=file</code><span><a class="mark" href="#--icu-data-dirfile" id="--icu-data-dirfile">#</a></span><a aria-hidden="true" class="legacy" id="cli_icu_data_dir_file"></a></h4> 11501cb0ef41Sopenharmony_ci<div class="api_metadata"> 11511cb0ef41Sopenharmony_ci<span>Added in: v0.11.15</span> 11521cb0ef41Sopenharmony_ci</div> 11531cb0ef41Sopenharmony_ci<p>Specify ICU data load path. (Overrides <code>NODE_ICU_DATA</code>.)</p> 11541cb0ef41Sopenharmony_ci<h4><code>--import=module</code><span><a class="mark" href="#--importmodule" id="--importmodule">#</a></span><a aria-hidden="true" class="legacy" id="cli_import_module"></a></h4> 11551cb0ef41Sopenharmony_ci<div class="api_metadata"> 11561cb0ef41Sopenharmony_ci<span>Added in: v18.18.0</span> 11571cb0ef41Sopenharmony_ci</div> 11581cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 11591cb0ef41Sopenharmony_ci<p>Preload the specified module at startup.</p> 11601cb0ef41Sopenharmony_ci<p>Follows <a href="esm.html#modules-ecmascript-modules">ECMAScript module</a> resolution rules. 11611cb0ef41Sopenharmony_ciUse <a href="#-r---require-module"><code>--require</code></a> to load a <a href="modules.html">CommonJS module</a>. 11621cb0ef41Sopenharmony_ciModules preloaded with <code>--require</code> will run before modules preloaded with <code>--import</code>.</p> 11631cb0ef41Sopenharmony_ci<h4><code>--input-type=type</code><span><a class="mark" href="#--input-typetype" id="--input-typetype">#</a></span><a aria-hidden="true" class="legacy" id="cli_input_type_type"></a></h4> 11641cb0ef41Sopenharmony_ci<div class="api_metadata"> 11651cb0ef41Sopenharmony_ci<span>Added in: v12.0.0</span> 11661cb0ef41Sopenharmony_ci</div> 11671cb0ef41Sopenharmony_ci<p>This configures Node.js to interpret string input as CommonJS or as an ES 11681cb0ef41Sopenharmony_cimodule. String input is input via <code>--eval</code>, <code>--print</code>, or <code>STDIN</code>.</p> 11691cb0ef41Sopenharmony_ci<p>Valid values are <code>"commonjs"</code> and <code>"module"</code>. The default is <code>"commonjs"</code>.</p> 11701cb0ef41Sopenharmony_ci<p>The REPL does not support this option.</p> 11711cb0ef41Sopenharmony_ci<h4><code>--inspect-brk[=[host:]port]</code><span><a class="mark" href="#--inspect-brkhostport" id="--inspect-brkhostport">#</a></span><a aria-hidden="true" class="legacy" id="cli_inspect_brk_host_port"></a></h4> 11721cb0ef41Sopenharmony_ci<div class="api_metadata"> 11731cb0ef41Sopenharmony_ci<span>Added in: v7.6.0</span> 11741cb0ef41Sopenharmony_ci</div> 11751cb0ef41Sopenharmony_ci<p>Activate inspector on <code>host:port</code> and break at start of user script. 11761cb0ef41Sopenharmony_ciDefault <code>host:port</code> is <code>127.0.0.1:9229</code>.</p> 11771cb0ef41Sopenharmony_ci<h4><code>--inspect-port=[host:]port</code><span><a class="mark" href="#--inspect-porthostport" id="--inspect-porthostport">#</a></span><a aria-hidden="true" class="legacy" id="cli_inspect_port_host_port"></a></h4> 11781cb0ef41Sopenharmony_ci<div class="api_metadata"> 11791cb0ef41Sopenharmony_ci<span>Added in: v7.6.0</span> 11801cb0ef41Sopenharmony_ci</div> 11811cb0ef41Sopenharmony_ci<p>Set the <code>host:port</code> to be used when the inspector is activated. 11821cb0ef41Sopenharmony_ciUseful when activating the inspector by sending the <code>SIGUSR1</code> signal.</p> 11831cb0ef41Sopenharmony_ci<p>Default host is <code>127.0.0.1</code>.</p> 11841cb0ef41Sopenharmony_ci<p>See the <a href="#warning-binding-inspector-to-a-public-ipport-combination-is-insecure">security warning</a> below regarding the <code>host</code> 11851cb0ef41Sopenharmony_ciparameter usage.</p> 11861cb0ef41Sopenharmony_ci<h4><code>--inspect[=[host:]port]</code><span><a class="mark" href="#--inspecthostport" id="--inspecthostport">#</a></span><a aria-hidden="true" class="legacy" id="cli_inspect_host_port"></a></h4> 11871cb0ef41Sopenharmony_ci<div class="api_metadata"> 11881cb0ef41Sopenharmony_ci<span>Added in: v6.3.0</span> 11891cb0ef41Sopenharmony_ci</div> 11901cb0ef41Sopenharmony_ci<p>Activate inspector on <code>host:port</code>. Default is <code>127.0.0.1:9229</code>.</p> 11911cb0ef41Sopenharmony_ci<p>V8 inspector integration allows tools such as Chrome DevTools and IDEs to debug 11921cb0ef41Sopenharmony_ciand profile Node.js instances. The tools attach to Node.js instances via a 11931cb0ef41Sopenharmony_citcp port and communicate using the <a href="https://chromedevtools.github.io/devtools-protocol/">Chrome DevTools Protocol</a>.</p> 11941cb0ef41Sopenharmony_ci<!-- Anchor to make sure old links find a target --> 11951cb0ef41Sopenharmony_ci<p><a id="inspector_security"></a></p> 11961cb0ef41Sopenharmony_ci<h5>Warning: binding inspector to a public IP:port combination is insecure<span><a class="mark" href="#warning-binding-inspector-to-a-public-ipport-combination-is-insecure" id="warning-binding-inspector-to-a-public-ipport-combination-is-insecure">#</a></span><a aria-hidden="true" class="legacy" id="cli_warning_binding_inspector_to_a_public_ip_port_combination_is_insecure"></a></h5> 11971cb0ef41Sopenharmony_ci<p>Binding the inspector to a public IP (including <code>0.0.0.0</code>) with an open port is 11981cb0ef41Sopenharmony_ciinsecure, as it allows external hosts to connect to the inspector and perform 11991cb0ef41Sopenharmony_cia <a href="https://www.owasp.org/index.php/Code_Injection">remote code execution</a> attack.</p> 12001cb0ef41Sopenharmony_ci<p>If specifying a host, make sure that either:</p> 12011cb0ef41Sopenharmony_ci<ul> 12021cb0ef41Sopenharmony_ci<li>The host is not accessible from public networks.</li> 12031cb0ef41Sopenharmony_ci<li>A firewall disallows unwanted connections on the port.</li> 12041cb0ef41Sopenharmony_ci</ul> 12051cb0ef41Sopenharmony_ci<p><strong>More specifically, <code>--inspect=0.0.0.0</code> is insecure if the port (<code>9229</code> by 12061cb0ef41Sopenharmony_cidefault) is not firewall-protected.</strong></p> 12071cb0ef41Sopenharmony_ci<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> 12081cb0ef41Sopenharmony_ci<h4><code>--inspect-publish-uid=stderr,http</code><span><a class="mark" href="#--inspect-publish-uidstderrhttp" id="--inspect-publish-uidstderrhttp">#</a></span><a aria-hidden="true" class="legacy" id="cli_inspect_publish_uid_stderr_http"></a></h4> 12091cb0ef41Sopenharmony_ci<p>Specify ways of the inspector web socket url exposure.</p> 12101cb0ef41Sopenharmony_ci<p>By default inspector websocket url is available in stderr and under <code>/json/list</code> 12111cb0ef41Sopenharmony_ciendpoint on <code>http://host:port/json/list</code>.</p> 12121cb0ef41Sopenharmony_ci<h4><code>--insecure-http-parser</code><span><a class="mark" href="#--insecure-http-parser" id="--insecure-http-parser">#</a></span><a aria-hidden="true" class="legacy" id="cli_insecure_http_parser"></a></h4> 12131cb0ef41Sopenharmony_ci<div class="api_metadata"> 12141cb0ef41Sopenharmony_ci<span>Added in: v13.4.0, v12.15.0, v10.19.0</span> 12151cb0ef41Sopenharmony_ci</div> 12161cb0ef41Sopenharmony_ci<p>Use an insecure HTTP parser that accepts invalid HTTP headers. This may allow 12171cb0ef41Sopenharmony_ciinteroperability with non-conformant HTTP implementations. It may also allow 12181cb0ef41Sopenharmony_cirequest smuggling and other HTTP attacks that rely on invalid headers being 12191cb0ef41Sopenharmony_ciaccepted. Avoid using this option.</p> 12201cb0ef41Sopenharmony_ci<h4><code>--jitless</code><span><a class="mark" href="#--jitless" id="--jitless">#</a></span><a aria-hidden="true" class="legacy" id="cli_jitless"></a></h4> 12211cb0ef41Sopenharmony_ci<div class="api_metadata"> 12221cb0ef41Sopenharmony_ci<span>Added in: v12.0.0</span> 12231cb0ef41Sopenharmony_ci</div> 12241cb0ef41Sopenharmony_ci<p>Disable <a href="https://v8.dev/blog/jitless">runtime allocation of executable memory</a>. This may be 12251cb0ef41Sopenharmony_cirequired on some platforms for security reasons. It can also reduce attack 12261cb0ef41Sopenharmony_cisurface on other platforms, but the performance impact may be severe.</p> 12271cb0ef41Sopenharmony_ci<p>This flag is inherited from V8 and is subject to change upstream. It may 12281cb0ef41Sopenharmony_cidisappear in a non-semver-major release.</p> 12291cb0ef41Sopenharmony_ci<h4><code>--max-http-header-size=size</code><span><a class="mark" href="#--max-http-header-sizesize" id="--max-http-header-sizesize">#</a></span><a aria-hidden="true" class="legacy" id="cli_max_http_header_size_size"></a></h4> 12301cb0ef41Sopenharmony_ci<div class="api_metadata"> 12311cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 12321cb0ef41Sopenharmony_ci<table> 12331cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 12341cb0ef41Sopenharmony_ci<tr><td>v13.13.0</td> 12351cb0ef41Sopenharmony_ci<td><p>Change maximum default size of HTTP headers from 8 KiB to 16 KiB.</p></td></tr> 12361cb0ef41Sopenharmony_ci<tr><td>v11.6.0, v10.15.0</td> 12371cb0ef41Sopenharmony_ci<td><p><span>Added in: v11.6.0, v10.15.0</span></p></td></tr> 12381cb0ef41Sopenharmony_ci</tbody></table> 12391cb0ef41Sopenharmony_ci</details> 12401cb0ef41Sopenharmony_ci</div> 12411cb0ef41Sopenharmony_ci<p>Specify the maximum size, in bytes, of HTTP headers. Defaults to 16 KiB.</p> 12421cb0ef41Sopenharmony_ci<h4><code>--napi-modules</code><span><a class="mark" href="#--napi-modules" id="--napi-modules">#</a></span><a aria-hidden="true" class="legacy" id="cli_napi_modules"></a></h4> 12431cb0ef41Sopenharmony_ci<div class="api_metadata"> 12441cb0ef41Sopenharmony_ci<span>Added in: v7.10.0</span> 12451cb0ef41Sopenharmony_ci</div> 12461cb0ef41Sopenharmony_ci<p>This option is a no-op. It is kept for compatibility.</p> 12471cb0ef41Sopenharmony_ci<h4><code>--no-addons</code><span><a class="mark" href="#--no-addons" id="--no-addons">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_addons"></a></h4> 12481cb0ef41Sopenharmony_ci<div class="api_metadata"> 12491cb0ef41Sopenharmony_ci<span>Added in: v16.10.0, v14.19.0</span> 12501cb0ef41Sopenharmony_ci</div> 12511cb0ef41Sopenharmony_ci<p>Disable the <code>node-addons</code> exports condition as well as disable loading 12521cb0ef41Sopenharmony_cinative addons. When <code>--no-addons</code> is specified, calling <code>process.dlopen</code> or 12531cb0ef41Sopenharmony_cirequiring a native C++ addon will fail and throw an exception.</p> 12541cb0ef41Sopenharmony_ci<h4><code>--no-deprecation</code><span><a class="mark" href="#--no-deprecation" id="--no-deprecation">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_deprecation"></a></h4> 12551cb0ef41Sopenharmony_ci<div class="api_metadata"> 12561cb0ef41Sopenharmony_ci<span>Added in: v0.8.0</span> 12571cb0ef41Sopenharmony_ci</div> 12581cb0ef41Sopenharmony_ci<p>Silence deprecation warnings.</p> 12591cb0ef41Sopenharmony_ci<h4><code>--no-extra-info-on-fatal-exception</code><span><a class="mark" href="#--no-extra-info-on-fatal-exception" id="--no-extra-info-on-fatal-exception">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_extra_info_on_fatal_exception"></a></h4> 12601cb0ef41Sopenharmony_ci<div class="api_metadata"> 12611cb0ef41Sopenharmony_ci<span>Added in: v17.0.0</span> 12621cb0ef41Sopenharmony_ci</div> 12631cb0ef41Sopenharmony_ci<p>Hide extra information on fatal exception that causes exit.</p> 12641cb0ef41Sopenharmony_ci<h4><code>--no-force-async-hooks-checks</code><span><a class="mark" href="#--no-force-async-hooks-checks" id="--no-force-async-hooks-checks">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_force_async_hooks_checks"></a></h4> 12651cb0ef41Sopenharmony_ci<div class="api_metadata"> 12661cb0ef41Sopenharmony_ci<span>Added in: v9.0.0</span> 12671cb0ef41Sopenharmony_ci</div> 12681cb0ef41Sopenharmony_ci<p>Disables runtime checks for <code>async_hooks</code>. These will still be enabled 12691cb0ef41Sopenharmony_cidynamically when <code>async_hooks</code> is enabled.</p> 12701cb0ef41Sopenharmony_ci<h4><code>--no-global-search-paths</code><span><a class="mark" href="#--no-global-search-paths" id="--no-global-search-paths">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_global_search_paths"></a></h4> 12711cb0ef41Sopenharmony_ci<div class="api_metadata"> 12721cb0ef41Sopenharmony_ci<span>Added in: v16.10.0</span> 12731cb0ef41Sopenharmony_ci</div> 12741cb0ef41Sopenharmony_ci<p>Do not search modules from global paths like <code>$HOME/.node_modules</code> and 12751cb0ef41Sopenharmony_ci<code>$NODE_PATH</code>.</p> 12761cb0ef41Sopenharmony_ci<h4><code>--no-warnings</code><span><a class="mark" href="#--no-warnings" id="--no-warnings">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_warnings"></a></h4> 12771cb0ef41Sopenharmony_ci<div class="api_metadata"> 12781cb0ef41Sopenharmony_ci<span>Added in: v6.0.0</span> 12791cb0ef41Sopenharmony_ci</div> 12801cb0ef41Sopenharmony_ci<p>Silence all process warnings (including deprecations).</p> 12811cb0ef41Sopenharmony_ci<h4><code>--node-memory-debug</code><span><a class="mark" href="#--node-memory-debug" id="--node-memory-debug">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_memory_debug"></a></h4> 12821cb0ef41Sopenharmony_ci<div class="api_metadata"> 12831cb0ef41Sopenharmony_ci<span>Added in: v15.0.0, v14.18.0</span> 12841cb0ef41Sopenharmony_ci</div> 12851cb0ef41Sopenharmony_ci<p>Enable extra debug checks for memory leaks in Node.js internals. This is 12861cb0ef41Sopenharmony_ciusually only useful for developers debugging Node.js itself.</p> 12871cb0ef41Sopenharmony_ci<h4><code>--openssl-config=file</code><span><a class="mark" href="#--openssl-configfile" id="--openssl-configfile">#</a></span><a aria-hidden="true" class="legacy" id="cli_openssl_config_file"></a></h4> 12881cb0ef41Sopenharmony_ci<div class="api_metadata"> 12891cb0ef41Sopenharmony_ci<span>Added in: v6.9.0</span> 12901cb0ef41Sopenharmony_ci</div> 12911cb0ef41Sopenharmony_ci<p>Load an OpenSSL configuration file on startup. Among other uses, this can be 12921cb0ef41Sopenharmony_ciused to enable FIPS-compliant crypto if Node.js is built 12931cb0ef41Sopenharmony_ciagainst FIPS-enabled OpenSSL.</p> 12941cb0ef41Sopenharmony_ci<h4><code>--openssl-shared-config</code><span><a class="mark" href="#--openssl-shared-config" id="--openssl-shared-config">#</a></span><a aria-hidden="true" class="legacy" id="cli_openssl_shared_config"></a></h4> 12951cb0ef41Sopenharmony_ci<div class="api_metadata"> 12961cb0ef41Sopenharmony_ci<span>Added in: v18.5.0</span> 12971cb0ef41Sopenharmony_ci</div> 12981cb0ef41Sopenharmony_ci<p>Enable OpenSSL default configuration section, <code>openssl_conf</code> to be read from 12991cb0ef41Sopenharmony_cithe OpenSSL configuration file. The default configuration file is named 13001cb0ef41Sopenharmony_ci<code>openssl.cnf</code> but this can be changed using the environment variable 13011cb0ef41Sopenharmony_ci<code>OPENSSL_CONF</code>, or by using the command line option <code>--openssl-config</code>. 13021cb0ef41Sopenharmony_ciThe location of the default OpenSSL configuration file depends on how OpenSSL 13031cb0ef41Sopenharmony_ciis being linked to Node.js. Sharing the OpenSSL configuration may have unwanted 13041cb0ef41Sopenharmony_ciimplications and it is recommended to use a configuration section specific to 13051cb0ef41Sopenharmony_ciNode.js which is <code>nodejs_conf</code> and is default when this option is not used.</p> 13061cb0ef41Sopenharmony_ci<h4><code>--openssl-legacy-provider</code><span><a class="mark" href="#--openssl-legacy-provider" id="--openssl-legacy-provider">#</a></span><a aria-hidden="true" class="legacy" id="cli_openssl_legacy_provider"></a></h4> 13071cb0ef41Sopenharmony_ci<div class="api_metadata"> 13081cb0ef41Sopenharmony_ci<span>Added in: v17.0.0</span> 13091cb0ef41Sopenharmony_ci</div> 13101cb0ef41Sopenharmony_ci<p>Enable OpenSSL 3.0 legacy provider. For more information please see 13111cb0ef41Sopenharmony_ci<a href="https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html">OSSL_PROVIDER-legacy</a>.</p> 13121cb0ef41Sopenharmony_ci<h4><code>--pending-deprecation</code><span><a class="mark" href="#--pending-deprecation" id="--pending-deprecation">#</a></span><a aria-hidden="true" class="legacy" id="cli_pending_deprecation"></a></h4> 13131cb0ef41Sopenharmony_ci<div class="api_metadata"> 13141cb0ef41Sopenharmony_ci<span>Added in: v8.0.0</span> 13151cb0ef41Sopenharmony_ci</div> 13161cb0ef41Sopenharmony_ci<p>Emit pending deprecation warnings.</p> 13171cb0ef41Sopenharmony_ci<p>Pending deprecations are generally identical to a runtime deprecation with the 13181cb0ef41Sopenharmony_cinotable exception that they are turned <em>off</em> by default and will not be emitted 13191cb0ef41Sopenharmony_ciunless either the <code>--pending-deprecation</code> command-line flag, or the 13201cb0ef41Sopenharmony_ci<code>NODE_PENDING_DEPRECATION=1</code> environment variable, is set. Pending deprecations 13211cb0ef41Sopenharmony_ciare used to provide a kind of selective "early warning" mechanism that 13221cb0ef41Sopenharmony_cidevelopers may leverage to detect deprecated API usage.</p> 13231cb0ef41Sopenharmony_ci<h4><code>--policy-integrity=sri</code><span><a class="mark" href="#--policy-integritysri" id="--policy-integritysri">#</a></span><a aria-hidden="true" class="legacy" id="cli_policy_integrity_sri"></a></h4> 13241cb0ef41Sopenharmony_ci<div class="api_metadata"> 13251cb0ef41Sopenharmony_ci<span>Added in: v12.7.0</span> 13261cb0ef41Sopenharmony_ci</div> 13271cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 13281cb0ef41Sopenharmony_ci<p>Instructs Node.js to error prior to running any code if the policy does not have 13291cb0ef41Sopenharmony_cithe specified integrity. It expects a <a href="https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity">Subresource Integrity</a> string as a 13301cb0ef41Sopenharmony_ciparameter.</p> 13311cb0ef41Sopenharmony_ci<h4><code>--preserve-symlinks</code><span><a class="mark" href="#--preserve-symlinks" id="--preserve-symlinks">#</a></span><a aria-hidden="true" class="legacy" id="cli_preserve_symlinks"></a></h4> 13321cb0ef41Sopenharmony_ci<div class="api_metadata"> 13331cb0ef41Sopenharmony_ci<span>Added in: v6.3.0</span> 13341cb0ef41Sopenharmony_ci</div> 13351cb0ef41Sopenharmony_ci<p>Instructs the module loader to preserve symbolic links when resolving and 13361cb0ef41Sopenharmony_cicaching modules.</p> 13371cb0ef41Sopenharmony_ci<p>By default, when Node.js loads a module from a path that is symbolically linked 13381cb0ef41Sopenharmony_cito a different on-disk location, Node.js will dereference the link and use the 13391cb0ef41Sopenharmony_ciactual on-disk "real path" of the module as both an identifier and as a root 13401cb0ef41Sopenharmony_cipath to locate other dependency modules. In most cases, this default behavior 13411cb0ef41Sopenharmony_ciis acceptable. However, when using symbolically linked peer dependencies, as 13421cb0ef41Sopenharmony_ciillustrated in the example below, the default behavior causes an exception to 13431cb0ef41Sopenharmony_cibe thrown if <code>moduleA</code> attempts to require <code>moduleB</code> as a peer dependency:</p> 13441cb0ef41Sopenharmony_ci<pre><code class="language-text">{appDir} 13451cb0ef41Sopenharmony_ci ├── app 13461cb0ef41Sopenharmony_ci │ ├── index.js 13471cb0ef41Sopenharmony_ci │ └── node_modules 13481cb0ef41Sopenharmony_ci │ ├── moduleA -> {appDir}/moduleA 13491cb0ef41Sopenharmony_ci │ └── moduleB 13501cb0ef41Sopenharmony_ci │ ├── index.js 13511cb0ef41Sopenharmony_ci │ └── package.json 13521cb0ef41Sopenharmony_ci └── moduleA 13531cb0ef41Sopenharmony_ci ├── index.js 13541cb0ef41Sopenharmony_ci └── package.json</code> <button class="copy-button">copy</button></pre> 13551cb0ef41Sopenharmony_ci<p>The <code>--preserve-symlinks</code> command-line flag instructs Node.js to use the 13561cb0ef41Sopenharmony_cisymlink path for modules as opposed to the real path, allowing symbolically 13571cb0ef41Sopenharmony_cilinked peer dependencies to be found.</p> 13581cb0ef41Sopenharmony_ci<p>Note, however, that using <code>--preserve-symlinks</code> can have other side effects. 13591cb0ef41Sopenharmony_ciSpecifically, symbolically linked <em>native</em> modules can fail to load if those 13601cb0ef41Sopenharmony_ciare linked from more than one location in the dependency tree (Node.js would 13611cb0ef41Sopenharmony_cisee those as two separate modules and would attempt to load the module multiple 13621cb0ef41Sopenharmony_citimes, causing an exception to be thrown).</p> 13631cb0ef41Sopenharmony_ci<p>The <code>--preserve-symlinks</code> flag does not apply to the main module, which allows 13641cb0ef41Sopenharmony_ci<code>node --preserve-symlinks node_module/.bin/<foo></code> to work. To apply the same 13651cb0ef41Sopenharmony_cibehavior for the main module, also use <code>--preserve-symlinks-main</code>.</p> 13661cb0ef41Sopenharmony_ci<h4><code>--preserve-symlinks-main</code><span><a class="mark" href="#--preserve-symlinks-main" id="--preserve-symlinks-main">#</a></span><a aria-hidden="true" class="legacy" id="cli_preserve_symlinks_main"></a></h4> 13671cb0ef41Sopenharmony_ci<div class="api_metadata"> 13681cb0ef41Sopenharmony_ci<span>Added in: v10.2.0</span> 13691cb0ef41Sopenharmony_ci</div> 13701cb0ef41Sopenharmony_ci<p>Instructs the module loader to preserve symbolic links when resolving and 13711cb0ef41Sopenharmony_cicaching the main module (<code>require.main</code>).</p> 13721cb0ef41Sopenharmony_ci<p>This flag exists so that the main module can be opted-in to the same behavior 13731cb0ef41Sopenharmony_cithat <code>--preserve-symlinks</code> gives to all other imports; they are separate flags, 13741cb0ef41Sopenharmony_cihowever, for backward compatibility with older Node.js versions.</p> 13751cb0ef41Sopenharmony_ci<p><code>--preserve-symlinks-main</code> does not imply <code>--preserve-symlinks</code>; use 13761cb0ef41Sopenharmony_ci<code>--preserve-symlinks-main</code> in addition to 13771cb0ef41Sopenharmony_ci<code>--preserve-symlinks</code> when it is not desirable to follow symlinks before 13781cb0ef41Sopenharmony_ciresolving relative paths.</p> 13791cb0ef41Sopenharmony_ci<p>See <a href="#--preserve-symlinks"><code>--preserve-symlinks</code></a> for more information.</p> 13801cb0ef41Sopenharmony_ci<h4><code>--prof</code><span><a class="mark" href="#--prof" id="--prof">#</a></span><a aria-hidden="true" class="legacy" id="cli_prof"></a></h4> 13811cb0ef41Sopenharmony_ci<div class="api_metadata"> 13821cb0ef41Sopenharmony_ci<span>Added in: v2.0.0</span> 13831cb0ef41Sopenharmony_ci</div> 13841cb0ef41Sopenharmony_ci<p>Generate V8 profiler output.</p> 13851cb0ef41Sopenharmony_ci<h4><code>--prof-process</code><span><a class="mark" href="#--prof-process" id="--prof-process">#</a></span><a aria-hidden="true" class="legacy" id="cli_prof_process"></a></h4> 13861cb0ef41Sopenharmony_ci<div class="api_metadata"> 13871cb0ef41Sopenharmony_ci<span>Added in: v5.2.0</span> 13881cb0ef41Sopenharmony_ci</div> 13891cb0ef41Sopenharmony_ci<p>Process V8 profiler output generated using the V8 option <code>--prof</code>.</p> 13901cb0ef41Sopenharmony_ci<h4><code>--redirect-warnings=file</code><span><a class="mark" href="#--redirect-warningsfile" id="--redirect-warningsfile">#</a></span><a aria-hidden="true" class="legacy" id="cli_redirect_warnings_file"></a></h4> 13911cb0ef41Sopenharmony_ci<div class="api_metadata"> 13921cb0ef41Sopenharmony_ci<span>Added in: v8.0.0</span> 13931cb0ef41Sopenharmony_ci</div> 13941cb0ef41Sopenharmony_ci<p>Write process warnings to the given file instead of printing to stderr. The 13951cb0ef41Sopenharmony_cifile will be created if it does not exist, and will be appended to if it does. 13961cb0ef41Sopenharmony_ciIf an error occurs while attempting to write the warning to the file, the 13971cb0ef41Sopenharmony_ciwarning will be written to stderr instead.</p> 13981cb0ef41Sopenharmony_ci<p>The <code>file</code> name may be an absolute path. If it is not, the default directory it 13991cb0ef41Sopenharmony_ciwill be written to is controlled by the 14001cb0ef41Sopenharmony_ci<a href="#--diagnostic-dirdirectory"><code>--diagnostic-dir</code></a> command-line option.</p> 14011cb0ef41Sopenharmony_ci<h4><code>--report-compact</code><span><a class="mark" href="#--report-compact" id="--report-compact">#</a></span><a aria-hidden="true" class="legacy" id="cli_report_compact"></a></h4> 14021cb0ef41Sopenharmony_ci<div class="api_metadata"> 14031cb0ef41Sopenharmony_ci<span>Added in: v13.12.0, v12.17.0</span> 14041cb0ef41Sopenharmony_ci</div> 14051cb0ef41Sopenharmony_ci<p>Write reports in a compact format, single-line JSON, more easily consumable 14061cb0ef41Sopenharmony_ciby log processing systems than the default multi-line format designed for 14071cb0ef41Sopenharmony_cihuman consumption.</p> 14081cb0ef41Sopenharmony_ci<h4><code>--report-dir=directory</code>, <code>report-directory=directory</code><span><a class="mark" href="#--report-dirdirectory-report-directorydirectory" id="--report-dirdirectory-report-directorydirectory">#</a></span><a aria-hidden="true" class="legacy" id="cli_report_dir_directory_report_directory_directory"></a></h4> 14091cb0ef41Sopenharmony_ci<div class="api_metadata"> 14101cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 14111cb0ef41Sopenharmony_ci<table> 14121cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 14131cb0ef41Sopenharmony_ci<tr><td>v13.12.0, v12.17.0</td> 14141cb0ef41Sopenharmony_ci<td><p>This option is no longer experimental.</p></td></tr> 14151cb0ef41Sopenharmony_ci<tr><td>v12.0.0</td> 14161cb0ef41Sopenharmony_ci<td><p>Changed from <code>--diagnostic-report-directory</code> to <code>--report-directory</code>.</p></td></tr> 14171cb0ef41Sopenharmony_ci<tr><td>v11.8.0</td> 14181cb0ef41Sopenharmony_ci<td><p><span>Added in: v11.8.0</span></p></td></tr> 14191cb0ef41Sopenharmony_ci</tbody></table> 14201cb0ef41Sopenharmony_ci</details> 14211cb0ef41Sopenharmony_ci</div> 14221cb0ef41Sopenharmony_ci<p>Location at which the report will be generated.</p> 14231cb0ef41Sopenharmony_ci<h4><code>--report-filename=filename</code><span><a class="mark" href="#--report-filenamefilename" id="--report-filenamefilename">#</a></span><a aria-hidden="true" class="legacy" id="cli_report_filename_filename"></a></h4> 14241cb0ef41Sopenharmony_ci<div class="api_metadata"> 14251cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 14261cb0ef41Sopenharmony_ci<table> 14271cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 14281cb0ef41Sopenharmony_ci<tr><td>v13.12.0, v12.17.0</td> 14291cb0ef41Sopenharmony_ci<td><p>This option is no longer experimental.</p></td></tr> 14301cb0ef41Sopenharmony_ci<tr><td>v12.0.0</td> 14311cb0ef41Sopenharmony_ci<td><p>changed from <code>--diagnostic-report-filename</code> to <code>--report-filename</code>.</p></td></tr> 14321cb0ef41Sopenharmony_ci<tr><td>v11.8.0</td> 14331cb0ef41Sopenharmony_ci<td><p><span>Added in: v11.8.0</span></p></td></tr> 14341cb0ef41Sopenharmony_ci</tbody></table> 14351cb0ef41Sopenharmony_ci</details> 14361cb0ef41Sopenharmony_ci</div> 14371cb0ef41Sopenharmony_ci<p>Name of the file to which the report will be written.</p> 14381cb0ef41Sopenharmony_ci<p>If the filename is set to <code>'stdout'</code> or <code>'stderr'</code>, the report is written to 14391cb0ef41Sopenharmony_cithe stdout or stderr of the process respectively.</p> 14401cb0ef41Sopenharmony_ci<h4><code>--report-on-fatalerror</code><span><a class="mark" href="#--report-on-fatalerror" id="--report-on-fatalerror">#</a></span><a aria-hidden="true" class="legacy" id="cli_report_on_fatalerror"></a></h4> 14411cb0ef41Sopenharmony_ci<div class="api_metadata"> 14421cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 14431cb0ef41Sopenharmony_ci<table> 14441cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 14451cb0ef41Sopenharmony_ci<tr><td>v14.0.0, v13.14.0, v12.17.0</td> 14461cb0ef41Sopenharmony_ci<td><p>This option is no longer experimental.</p></td></tr> 14471cb0ef41Sopenharmony_ci<tr><td>v12.0.0</td> 14481cb0ef41Sopenharmony_ci<td><p>changed from <code>--diagnostic-report-on-fatalerror</code> to <code>--report-on-fatalerror</code>.</p></td></tr> 14491cb0ef41Sopenharmony_ci<tr><td>v11.8.0</td> 14501cb0ef41Sopenharmony_ci<td><p><span>Added in: v11.8.0</span></p></td></tr> 14511cb0ef41Sopenharmony_ci</tbody></table> 14521cb0ef41Sopenharmony_ci</details> 14531cb0ef41Sopenharmony_ci</div> 14541cb0ef41Sopenharmony_ci<p>Enables the report to be triggered on fatal errors (internal errors within 14551cb0ef41Sopenharmony_cithe Node.js runtime such as out of memory) that lead to termination of the 14561cb0ef41Sopenharmony_ciapplication. Useful to inspect various diagnostic data elements such as heap, 14571cb0ef41Sopenharmony_cistack, event loop state, resource consumption etc. to reason about the fatal 14581cb0ef41Sopenharmony_cierror.</p> 14591cb0ef41Sopenharmony_ci<h4><code>--report-on-signal</code><span><a class="mark" href="#--report-on-signal" id="--report-on-signal">#</a></span><a aria-hidden="true" class="legacy" id="cli_report_on_signal"></a></h4> 14601cb0ef41Sopenharmony_ci<div class="api_metadata"> 14611cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 14621cb0ef41Sopenharmony_ci<table> 14631cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 14641cb0ef41Sopenharmony_ci<tr><td>v13.12.0, v12.17.0</td> 14651cb0ef41Sopenharmony_ci<td><p>This option is no longer experimental.</p></td></tr> 14661cb0ef41Sopenharmony_ci<tr><td>v12.0.0</td> 14671cb0ef41Sopenharmony_ci<td><p>changed from <code>--diagnostic-report-on-signal</code> to <code>--report-on-signal</code>.</p></td></tr> 14681cb0ef41Sopenharmony_ci<tr><td>v11.8.0</td> 14691cb0ef41Sopenharmony_ci<td><p><span>Added in: v11.8.0</span></p></td></tr> 14701cb0ef41Sopenharmony_ci</tbody></table> 14711cb0ef41Sopenharmony_ci</details> 14721cb0ef41Sopenharmony_ci</div> 14731cb0ef41Sopenharmony_ci<p>Enables report to be generated upon receiving the specified (or predefined) 14741cb0ef41Sopenharmony_cisignal to the running Node.js process. The signal to trigger the report is 14751cb0ef41Sopenharmony_cispecified through <code>--report-signal</code>.</p> 14761cb0ef41Sopenharmony_ci<h4><code>--report-signal=signal</code><span><a class="mark" href="#--report-signalsignal" id="--report-signalsignal">#</a></span><a aria-hidden="true" class="legacy" id="cli_report_signal_signal"></a></h4> 14771cb0ef41Sopenharmony_ci<div class="api_metadata"> 14781cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 14791cb0ef41Sopenharmony_ci<table> 14801cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 14811cb0ef41Sopenharmony_ci<tr><td>v13.12.0, v12.17.0</td> 14821cb0ef41Sopenharmony_ci<td><p>This option is no longer experimental.</p></td></tr> 14831cb0ef41Sopenharmony_ci<tr><td>v12.0.0</td> 14841cb0ef41Sopenharmony_ci<td><p>changed from <code>--diagnostic-report-signal</code> to <code>--report-signal</code>.</p></td></tr> 14851cb0ef41Sopenharmony_ci<tr><td>v11.8.0</td> 14861cb0ef41Sopenharmony_ci<td><p><span>Added in: v11.8.0</span></p></td></tr> 14871cb0ef41Sopenharmony_ci</tbody></table> 14881cb0ef41Sopenharmony_ci</details> 14891cb0ef41Sopenharmony_ci</div> 14901cb0ef41Sopenharmony_ci<p>Sets or resets the signal for report generation (not supported on Windows). 14911cb0ef41Sopenharmony_ciDefault signal is <code>SIGUSR2</code>.</p> 14921cb0ef41Sopenharmony_ci<h4><code>--report-uncaught-exception</code><span><a class="mark" href="#--report-uncaught-exception" id="--report-uncaught-exception">#</a></span><a aria-hidden="true" class="legacy" id="cli_report_uncaught_exception"></a></h4> 14931cb0ef41Sopenharmony_ci<div class="api_metadata"> 14941cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 14951cb0ef41Sopenharmony_ci<table> 14961cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 14971cb0ef41Sopenharmony_ci<tr><td>v18.8.0</td> 14981cb0ef41Sopenharmony_ci<td><p>Report is not generated if the uncaught exception is handled.</p></td></tr> 14991cb0ef41Sopenharmony_ci<tr><td>v13.12.0, v12.17.0</td> 15001cb0ef41Sopenharmony_ci<td><p>This option is no longer experimental.</p></td></tr> 15011cb0ef41Sopenharmony_ci<tr><td>v12.0.0</td> 15021cb0ef41Sopenharmony_ci<td><p>changed from <code>--diagnostic-report-uncaught-exception</code> to <code>--report-uncaught-exception</code>.</p></td></tr> 15031cb0ef41Sopenharmony_ci<tr><td>v11.8.0</td> 15041cb0ef41Sopenharmony_ci<td><p><span>Added in: v11.8.0</span></p></td></tr> 15051cb0ef41Sopenharmony_ci</tbody></table> 15061cb0ef41Sopenharmony_ci</details> 15071cb0ef41Sopenharmony_ci</div> 15081cb0ef41Sopenharmony_ci<p>Enables report to be generated when the process exits due to an uncaught 15091cb0ef41Sopenharmony_ciexception. Useful when inspecting the JavaScript stack in conjunction with 15101cb0ef41Sopenharmony_cinative stack and other runtime environment data.</p> 15111cb0ef41Sopenharmony_ci<h4><code>--secure-heap=n</code><span><a class="mark" href="#--secure-heapn" id="--secure-heapn">#</a></span><a aria-hidden="true" class="legacy" id="cli_secure_heap_n"></a></h4> 15121cb0ef41Sopenharmony_ci<div class="api_metadata"> 15131cb0ef41Sopenharmony_ci<span>Added in: v15.6.0</span> 15141cb0ef41Sopenharmony_ci</div> 15151cb0ef41Sopenharmony_ci<p>Initializes an OpenSSL secure heap of <code>n</code> bytes. When initialized, the 15161cb0ef41Sopenharmony_cisecure heap is used for selected types of allocations within OpenSSL 15171cb0ef41Sopenharmony_ciduring key generation and other operations. This is useful, for instance, 15181cb0ef41Sopenharmony_cito prevent sensitive information from leaking due to pointer overruns 15191cb0ef41Sopenharmony_cior underruns.</p> 15201cb0ef41Sopenharmony_ci<p>The secure heap is a fixed size and cannot be resized at runtime so, 15211cb0ef41Sopenharmony_ciif used, it is important to select a large enough heap to cover all 15221cb0ef41Sopenharmony_ciapplication uses.</p> 15231cb0ef41Sopenharmony_ci<p>The heap size given must be a power of two. Any value less than 2 15241cb0ef41Sopenharmony_ciwill disable the secure heap.</p> 15251cb0ef41Sopenharmony_ci<p>The secure heap is disabled by default.</p> 15261cb0ef41Sopenharmony_ci<p>The secure heap is not available on Windows.</p> 15271cb0ef41Sopenharmony_ci<p>See <a href="https://www.openssl.org/docs/man3.0/man3/CRYPTO_secure_malloc_init.html"><code>CRYPTO_secure_malloc_init</code></a> for more details.</p> 15281cb0ef41Sopenharmony_ci<h4><code>--secure-heap-min=n</code><span><a class="mark" href="#--secure-heap-minn" id="--secure-heap-minn">#</a></span><a aria-hidden="true" class="legacy" id="cli_secure_heap_min_n"></a></h4> 15291cb0ef41Sopenharmony_ci<div class="api_metadata"> 15301cb0ef41Sopenharmony_ci<span>Added in: v15.6.0</span> 15311cb0ef41Sopenharmony_ci</div> 15321cb0ef41Sopenharmony_ci<p>When using <code>--secure-heap</code>, the <code>--secure-heap-min</code> flag specifies the 15331cb0ef41Sopenharmony_ciminimum allocation from the secure heap. The minimum value is <code>2</code>. 15341cb0ef41Sopenharmony_ciThe maximum value is the lesser of <code>--secure-heap</code> or <code>2147483647</code>. 15351cb0ef41Sopenharmony_ciThe value given must be a power of two.</p> 15361cb0ef41Sopenharmony_ci<h4><code>--snapshot-blob=path</code><span><a class="mark" href="#--snapshot-blobpath" id="--snapshot-blobpath">#</a></span><a aria-hidden="true" class="legacy" id="cli_snapshot_blob_path"></a></h4> 15371cb0ef41Sopenharmony_ci<div class="api_metadata"> 15381cb0ef41Sopenharmony_ci<span>Added in: v18.8.0</span> 15391cb0ef41Sopenharmony_ci</div> 15401cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 15411cb0ef41Sopenharmony_ci<p>When used with <code>--build-snapshot</code>, <code>--snapshot-blob</code> specifies the path 15421cb0ef41Sopenharmony_ciwhere the generated snapshot blob is written to. If not specified, the 15431cb0ef41Sopenharmony_cigenerated blob is written to <code>snapshot.blob</code> in the current working directory.</p> 15441cb0ef41Sopenharmony_ci<p>When used without <code>--build-snapshot</code>, <code>--snapshot-blob</code> specifies the 15451cb0ef41Sopenharmony_cipath to the blob that is used to restore the application state.</p> 15461cb0ef41Sopenharmony_ci<p>When loading a snapshot, Node.js checks that:</p> 15471cb0ef41Sopenharmony_ci<ol> 15481cb0ef41Sopenharmony_ci<li>The version, architecture, and platform of the running Node.js binary 15491cb0ef41Sopenharmony_ciare exactly the same as that of the binary that generates the snapshot.</li> 15501cb0ef41Sopenharmony_ci<li>The V8 flags and CPU features are compatible with that of the binary 15511cb0ef41Sopenharmony_cithat generates the snapshot.</li> 15521cb0ef41Sopenharmony_ci</ol> 15531cb0ef41Sopenharmony_ci<p>If they don't match, Node.js refuses to load the snapshot and exits with 15541cb0ef41Sopenharmony_cistatus code 1.</p> 15551cb0ef41Sopenharmony_ci<h4><code>--test</code><span><a class="mark" href="#--test" id="--test">#</a></span><a aria-hidden="true" class="legacy" id="cli_test"></a></h4> 15561cb0ef41Sopenharmony_ci<div class="api_metadata"> 15571cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 15581cb0ef41Sopenharmony_ci<table> 15591cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 15601cb0ef41Sopenharmony_ci<tr><td>v18.13.0</td> 15611cb0ef41Sopenharmony_ci<td><p>Test runner now supports running in watch mode.</p></td></tr> 15621cb0ef41Sopenharmony_ci<tr><td>v18.1.0</td> 15631cb0ef41Sopenharmony_ci<td><p><span>Added in: v18.1.0</span></p></td></tr> 15641cb0ef41Sopenharmony_ci</tbody></table> 15651cb0ef41Sopenharmony_ci</details> 15661cb0ef41Sopenharmony_ci</div> 15671cb0ef41Sopenharmony_ci<p>Starts the Node.js command line test runner. This flag cannot be combined with 15681cb0ef41Sopenharmony_ci<code>--watch-path</code>, <code>--check</code>, <code>--eval</code>, <code>--interactive</code>, or the inspector. 15691cb0ef41Sopenharmony_ciSee the documentation on <a href="test.html#running-tests-from-the-command-line">running tests from the command line</a> 15701cb0ef41Sopenharmony_cifor more details.</p> 15711cb0ef41Sopenharmony_ci<h4><code>--test-concurrency</code><span><a class="mark" href="#--test-concurrency" id="--test-concurrency">#</a></span><a aria-hidden="true" class="legacy" id="cli_test_concurrency"></a></h4> 15721cb0ef41Sopenharmony_ci<div class="api_metadata"> 15731cb0ef41Sopenharmony_ci<span>Added in: v18.19.0</span> 15741cb0ef41Sopenharmony_ci</div> 15751cb0ef41Sopenharmony_ci<p>The maximum number of test files that the test runner CLI will execute 15761cb0ef41Sopenharmony_ciconcurrently. The default value is <code>os.availableParallelism() - 1</code>.</p> 15771cb0ef41Sopenharmony_ci<h4><code>--test-name-pattern</code><span><a class="mark" href="#--test-name-pattern" id="--test-name-pattern">#</a></span><a aria-hidden="true" class="legacy" id="cli_test_name_pattern"></a></h4> 15781cb0ef41Sopenharmony_ci<div class="api_metadata"> 15791cb0ef41Sopenharmony_ci<span>Added in: v18.11.0</span> 15801cb0ef41Sopenharmony_ci</div> 15811cb0ef41Sopenharmony_ci<p>A regular expression that configures the test runner to only execute tests 15821cb0ef41Sopenharmony_ciwhose name matches the provided pattern. See the documentation on 15831cb0ef41Sopenharmony_ci<a href="test.html#filtering-tests-by-name">filtering tests by name</a> for more details.</p> 15841cb0ef41Sopenharmony_ci<h4><code>--test-reporter</code><span><a class="mark" href="#--test-reporter" id="--test-reporter">#</a></span><a aria-hidden="true" class="legacy" id="cli_test_reporter"></a></h4> 15851cb0ef41Sopenharmony_ci<div class="api_metadata"> 15861cb0ef41Sopenharmony_ci<span>Added in: v18.15.0</span> 15871cb0ef41Sopenharmony_ci</div> 15881cb0ef41Sopenharmony_ci<p>A test reporter to use when running tests. See the documentation on 15891cb0ef41Sopenharmony_ci<a href="test.html#test-reporters">test reporters</a> for more details.</p> 15901cb0ef41Sopenharmony_ci<h4><code>--test-reporter-destination</code><span><a class="mark" href="#--test-reporter-destination" id="--test-reporter-destination">#</a></span><a aria-hidden="true" class="legacy" id="cli_test_reporter_destination"></a></h4> 15911cb0ef41Sopenharmony_ci<div class="api_metadata"> 15921cb0ef41Sopenharmony_ci<span>Added in: v18.15.0</span> 15931cb0ef41Sopenharmony_ci</div> 15941cb0ef41Sopenharmony_ci<p>The destination for the corresponding test reporter. See the documentation on 15951cb0ef41Sopenharmony_ci<a href="test.html#test-reporters">test reporters</a> for more details.</p> 15961cb0ef41Sopenharmony_ci<h4><code>--test-only</code><span><a class="mark" href="#--test-only" id="--test-only">#</a></span><a aria-hidden="true" class="legacy" id="cli_test_only"></a></h4> 15971cb0ef41Sopenharmony_ci<div class="api_metadata"> 15981cb0ef41Sopenharmony_ci<span>Added in: v18.0.0</span> 15991cb0ef41Sopenharmony_ci</div> 16001cb0ef41Sopenharmony_ci<p>Configures the test runner to only execute top level tests that have the <code>only</code> 16011cb0ef41Sopenharmony_cioption set.</p> 16021cb0ef41Sopenharmony_ci<h4><code>--test-shard</code><span><a class="mark" href="#--test-shard" id="--test-shard">#</a></span><a aria-hidden="true" class="legacy" id="cli_test_shard"></a></h4> 16031cb0ef41Sopenharmony_ci<div class="api_metadata"> 16041cb0ef41Sopenharmony_ci<span>Added in: v18.19.0</span> 16051cb0ef41Sopenharmony_ci</div> 16061cb0ef41Sopenharmony_ci<p>Test suite shard to execute in a format of <code><index>/<total></code>, where</p> 16071cb0ef41Sopenharmony_ci<p><code>index</code> is a positive integer, index of divided parts 16081cb0ef41Sopenharmony_ci<code>total</code> is a positive integer, total of divided part 16091cb0ef41Sopenharmony_ciThis command will divide all tests files into <code>total</code> equal parts, 16101cb0ef41Sopenharmony_ciand will run only those that happen to be in an <code>index</code> part.</p> 16111cb0ef41Sopenharmony_ci<p>For example, to split your tests suite into three parts, use this:</p> 16121cb0ef41Sopenharmony_ci<pre><code class="language-bash">node --<span class="hljs-built_in">test</span> --test-shard=1/3 16131cb0ef41Sopenharmony_cinode --<span class="hljs-built_in">test</span> --test-shard=2/3 16141cb0ef41Sopenharmony_cinode --<span class="hljs-built_in">test</span> --test-shard=3/3</code> <button class="copy-button">copy</button></pre> 16151cb0ef41Sopenharmony_ci<h4><code>--throw-deprecation</code><span><a class="mark" href="#--throw-deprecation" id="--throw-deprecation">#</a></span><a aria-hidden="true" class="legacy" id="cli_throw_deprecation"></a></h4> 16161cb0ef41Sopenharmony_ci<div class="api_metadata"> 16171cb0ef41Sopenharmony_ci<span>Added in: v0.11.14</span> 16181cb0ef41Sopenharmony_ci</div> 16191cb0ef41Sopenharmony_ci<p>Throw errors for deprecations.</p> 16201cb0ef41Sopenharmony_ci<h4><code>--title=title</code><span><a class="mark" href="#--titletitle" id="--titletitle">#</a></span><a aria-hidden="true" class="legacy" id="cli_title_title"></a></h4> 16211cb0ef41Sopenharmony_ci<div class="api_metadata"> 16221cb0ef41Sopenharmony_ci<span>Added in: v10.7.0</span> 16231cb0ef41Sopenharmony_ci</div> 16241cb0ef41Sopenharmony_ci<p>Set <code>process.title</code> on startup.</p> 16251cb0ef41Sopenharmony_ci<h4><code>--tls-cipher-list=list</code><span><a class="mark" href="#--tls-cipher-listlist" id="--tls-cipher-listlist">#</a></span><a aria-hidden="true" class="legacy" id="cli_tls_cipher_list_list"></a></h4> 16261cb0ef41Sopenharmony_ci<div class="api_metadata"> 16271cb0ef41Sopenharmony_ci<span>Added in: v4.0.0</span> 16281cb0ef41Sopenharmony_ci</div> 16291cb0ef41Sopenharmony_ci<p>Specify an alternative default TLS cipher list. Requires Node.js to be built 16301cb0ef41Sopenharmony_ciwith crypto support (default).</p> 16311cb0ef41Sopenharmony_ci<h4><code>--tls-keylog=file</code><span><a class="mark" href="#--tls-keylogfile" id="--tls-keylogfile">#</a></span><a aria-hidden="true" class="legacy" id="cli_tls_keylog_file"></a></h4> 16321cb0ef41Sopenharmony_ci<div class="api_metadata"> 16331cb0ef41Sopenharmony_ci<span>Added in: v13.2.0, v12.16.0</span> 16341cb0ef41Sopenharmony_ci</div> 16351cb0ef41Sopenharmony_ci<p>Log TLS key material to a file. The key material is in NSS <code>SSLKEYLOGFILE</code> 16361cb0ef41Sopenharmony_ciformat and can be used by software (such as Wireshark) to decrypt the TLS 16371cb0ef41Sopenharmony_citraffic.</p> 16381cb0ef41Sopenharmony_ci<h4><code>--tls-max-v1.2</code><span><a class="mark" href="#--tls-max-v12" id="--tls-max-v12">#</a></span><a aria-hidden="true" class="legacy" id="cli_tls_max_v1_2"></a></h4> 16391cb0ef41Sopenharmony_ci<div class="api_metadata"> 16401cb0ef41Sopenharmony_ci<span>Added in: v12.0.0, v10.20.0</span> 16411cb0ef41Sopenharmony_ci</div> 16421cb0ef41Sopenharmony_ci<p>Set <a href="tls.html#tlsdefault_max_version"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1.2'. Use to disable support for 16431cb0ef41Sopenharmony_ciTLSv1.3.</p> 16441cb0ef41Sopenharmony_ci<h4><code>--tls-max-v1.3</code><span><a class="mark" href="#--tls-max-v13" id="--tls-max-v13">#</a></span><a aria-hidden="true" class="legacy" id="cli_tls_max_v1_3"></a></h4> 16451cb0ef41Sopenharmony_ci<div class="api_metadata"> 16461cb0ef41Sopenharmony_ci<span>Added in: v12.0.0</span> 16471cb0ef41Sopenharmony_ci</div> 16481cb0ef41Sopenharmony_ci<p>Set default <a href="tls.html#tlsdefault_max_version"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1.3'. Use to enable support 16491cb0ef41Sopenharmony_cifor TLSv1.3.</p> 16501cb0ef41Sopenharmony_ci<h4><code>--tls-min-v1.0</code><span><a class="mark" href="#--tls-min-v10" id="--tls-min-v10">#</a></span><a aria-hidden="true" class="legacy" id="cli_tls_min_v1_0"></a></h4> 16511cb0ef41Sopenharmony_ci<div class="api_metadata"> 16521cb0ef41Sopenharmony_ci<span>Added in: v12.0.0, v10.20.0</span> 16531cb0ef41Sopenharmony_ci</div> 16541cb0ef41Sopenharmony_ci<p>Set default <a href="tls.html#tlsdefault_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1'. Use for compatibility with 16551cb0ef41Sopenharmony_ciold TLS clients or servers.</p> 16561cb0ef41Sopenharmony_ci<h4><code>--tls-min-v1.1</code><span><a class="mark" href="#--tls-min-v11" id="--tls-min-v11">#</a></span><a aria-hidden="true" class="legacy" id="cli_tls_min_v1_1"></a></h4> 16571cb0ef41Sopenharmony_ci<div class="api_metadata"> 16581cb0ef41Sopenharmony_ci<span>Added in: v12.0.0, v10.20.0</span> 16591cb0ef41Sopenharmony_ci</div> 16601cb0ef41Sopenharmony_ci<p>Set default <a href="tls.html#tlsdefault_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.1'. Use for compatibility 16611cb0ef41Sopenharmony_ciwith old TLS clients or servers.</p> 16621cb0ef41Sopenharmony_ci<h4><code>--tls-min-v1.2</code><span><a class="mark" href="#--tls-min-v12" id="--tls-min-v12">#</a></span><a aria-hidden="true" class="legacy" id="cli_tls_min_v1_2"></a></h4> 16631cb0ef41Sopenharmony_ci<div class="api_metadata"> 16641cb0ef41Sopenharmony_ci<span>Added in: v12.2.0, v10.20.0</span> 16651cb0ef41Sopenharmony_ci</div> 16661cb0ef41Sopenharmony_ci<p>Set default <a href="tls.html#tlsdefault_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.2'. This is the default for 16671cb0ef41Sopenharmony_ci12.x and later, but the option is supported for compatibility with older Node.js 16681cb0ef41Sopenharmony_civersions.</p> 16691cb0ef41Sopenharmony_ci<h4><code>--tls-min-v1.3</code><span><a class="mark" href="#--tls-min-v13" id="--tls-min-v13">#</a></span><a aria-hidden="true" class="legacy" id="cli_tls_min_v1_3"></a></h4> 16701cb0ef41Sopenharmony_ci<div class="api_metadata"> 16711cb0ef41Sopenharmony_ci<span>Added in: v12.0.0</span> 16721cb0ef41Sopenharmony_ci</div> 16731cb0ef41Sopenharmony_ci<p>Set default <a href="tls.html#tlsdefault_min_version"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.3'. Use to disable support 16741cb0ef41Sopenharmony_cifor TLSv1.2, which is not as secure as TLSv1.3.</p> 16751cb0ef41Sopenharmony_ci<h4><code>--trace-atomics-wait</code><span><a class="mark" href="#--trace-atomics-wait" id="--trace-atomics-wait">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_atomics_wait"></a></h4> 16761cb0ef41Sopenharmony_ci<div class="api_metadata"> 16771cb0ef41Sopenharmony_ci<span>Added in: v14.3.0</span><span>Deprecated since: v18.8.0</span> 16781cb0ef41Sopenharmony_ci</div> 16791cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_0"><a href="documentation.html#stability-index">Stability: 0</a> - Deprecated</div><p></p> 16801cb0ef41Sopenharmony_ci<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. 16811cb0ef41Sopenharmony_ciThe output could look like this:</p> 16821cb0ef41Sopenharmony_ci<pre><code class="language-text">(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf) started 16831cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 1, inf) did not wait because the values mismatched 16841cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 0, 10) started 16851cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 0, 0, 10) timed out 16861cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 4, 0, inf) started 16871cb0ef41Sopenharmony_ci(node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) started 16881cb0ef41Sopenharmony_ci(node:15701) [Thread 0] Atomics.wait(&lt;address> + 4, 0, inf) was woken up by another thread 16891cb0ef41Sopenharmony_ci(node:15701) [Thread 1] Atomics.wait(&lt;address> + 4, -1, inf) was woken up by another thread</code> <button class="copy-button">copy</button></pre> 16901cb0ef41Sopenharmony_ci<p>The fields here correspond to:</p> 16911cb0ef41Sopenharmony_ci<ul> 16921cb0ef41Sopenharmony_ci<li>The thread id as given by <a href="worker_threads.html#workerthreadid"><code>worker_threads.threadId</code></a></li> 16931cb0ef41Sopenharmony_ci<li>The base address of the <code>SharedArrayBuffer</code> in question, as well as the 16941cb0ef41Sopenharmony_cibyte offset corresponding to the index passed to <code>Atomics.wait()</code></li> 16951cb0ef41Sopenharmony_ci<li>The expected value that was passed to <code>Atomics.wait()</code></li> 16961cb0ef41Sopenharmony_ci<li>The timeout passed to <code>Atomics.wait</code></li> 16971cb0ef41Sopenharmony_ci</ul> 16981cb0ef41Sopenharmony_ci<h4><code>--trace-deprecation</code><span><a class="mark" href="#--trace-deprecation" id="--trace-deprecation">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_deprecation"></a></h4> 16991cb0ef41Sopenharmony_ci<div class="api_metadata"> 17001cb0ef41Sopenharmony_ci<span>Added in: v0.8.0</span> 17011cb0ef41Sopenharmony_ci</div> 17021cb0ef41Sopenharmony_ci<p>Print stack traces for deprecations.</p> 17031cb0ef41Sopenharmony_ci<h4><code>--trace-event-categories</code><span><a class="mark" href="#--trace-event-categories" id="--trace-event-categories">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_event_categories"></a></h4> 17041cb0ef41Sopenharmony_ci<div class="api_metadata"> 17051cb0ef41Sopenharmony_ci<span>Added in: v7.7.0</span> 17061cb0ef41Sopenharmony_ci</div> 17071cb0ef41Sopenharmony_ci<p>A comma separated list of categories that should be traced when trace event 17081cb0ef41Sopenharmony_citracing is enabled using <code>--trace-events-enabled</code>.</p> 17091cb0ef41Sopenharmony_ci<h4><code>--trace-event-file-pattern</code><span><a class="mark" href="#--trace-event-file-pattern" id="--trace-event-file-pattern">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_event_file_pattern"></a></h4> 17101cb0ef41Sopenharmony_ci<div class="api_metadata"> 17111cb0ef41Sopenharmony_ci<span>Added in: v9.8.0</span> 17121cb0ef41Sopenharmony_ci</div> 17131cb0ef41Sopenharmony_ci<p>Template string specifying the filepath for the trace event data, it 17141cb0ef41Sopenharmony_cisupports <code>${rotation}</code> and <code>${pid}</code>.</p> 17151cb0ef41Sopenharmony_ci<h4><code>--trace-events-enabled</code><span><a class="mark" href="#--trace-events-enabled" id="--trace-events-enabled">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_events_enabled"></a></h4> 17161cb0ef41Sopenharmony_ci<div class="api_metadata"> 17171cb0ef41Sopenharmony_ci<span>Added in: v7.7.0</span> 17181cb0ef41Sopenharmony_ci</div> 17191cb0ef41Sopenharmony_ci<p>Enables the collection of trace event tracing information.</p> 17201cb0ef41Sopenharmony_ci<h4><code>--trace-exit</code><span><a class="mark" href="#--trace-exit" id="--trace-exit">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_exit"></a></h4> 17211cb0ef41Sopenharmony_ci<div class="api_metadata"> 17221cb0ef41Sopenharmony_ci<span>Added in: v13.5.0, v12.16.0</span> 17231cb0ef41Sopenharmony_ci</div> 17241cb0ef41Sopenharmony_ci<p>Prints a stack trace whenever an environment is exited proactively, 17251cb0ef41Sopenharmony_cii.e. invoking <code>process.exit()</code>.</p> 17261cb0ef41Sopenharmony_ci<h4><code>--trace-sigint</code><span><a class="mark" href="#--trace-sigint" id="--trace-sigint">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_sigint"></a></h4> 17271cb0ef41Sopenharmony_ci<div class="api_metadata"> 17281cb0ef41Sopenharmony_ci<span>Added in: v13.9.0, v12.17.0</span> 17291cb0ef41Sopenharmony_ci</div> 17301cb0ef41Sopenharmony_ci<p>Prints a stack trace on SIGINT.</p> 17311cb0ef41Sopenharmony_ci<h4><code>--trace-sync-io</code><span><a class="mark" href="#--trace-sync-io" id="--trace-sync-io">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_sync_io"></a></h4> 17321cb0ef41Sopenharmony_ci<div class="api_metadata"> 17331cb0ef41Sopenharmony_ci<span>Added in: v2.1.0</span> 17341cb0ef41Sopenharmony_ci</div> 17351cb0ef41Sopenharmony_ci<p>Prints a stack trace whenever synchronous I/O is detected after the first turn 17361cb0ef41Sopenharmony_ciof the event loop.</p> 17371cb0ef41Sopenharmony_ci<h4><code>--trace-tls</code><span><a class="mark" href="#--trace-tls" id="--trace-tls">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_tls"></a></h4> 17381cb0ef41Sopenharmony_ci<div class="api_metadata"> 17391cb0ef41Sopenharmony_ci<span>Added in: v12.2.0</span> 17401cb0ef41Sopenharmony_ci</div> 17411cb0ef41Sopenharmony_ci<p>Prints TLS packet trace information to <code>stderr</code>. This can be used to debug TLS 17421cb0ef41Sopenharmony_ciconnection problems.</p> 17431cb0ef41Sopenharmony_ci<h4><code>--trace-uncaught</code><span><a class="mark" href="#--trace-uncaught" id="--trace-uncaught">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_uncaught"></a></h4> 17441cb0ef41Sopenharmony_ci<div class="api_metadata"> 17451cb0ef41Sopenharmony_ci<span>Added in: v13.1.0</span> 17461cb0ef41Sopenharmony_ci</div> 17471cb0ef41Sopenharmony_ci<p>Print stack traces for uncaught exceptions; usually, the stack trace associated 17481cb0ef41Sopenharmony_ciwith the creation of an <code>Error</code> is printed, whereas this makes Node.js also 17491cb0ef41Sopenharmony_ciprint the stack trace associated with throwing the value (which does not need 17501cb0ef41Sopenharmony_cito be an <code>Error</code> instance).</p> 17511cb0ef41Sopenharmony_ci<p>Enabling this option may affect garbage collection behavior negatively.</p> 17521cb0ef41Sopenharmony_ci<h4><code>--trace-warnings</code><span><a class="mark" href="#--trace-warnings" id="--trace-warnings">#</a></span><a aria-hidden="true" class="legacy" id="cli_trace_warnings"></a></h4> 17531cb0ef41Sopenharmony_ci<div class="api_metadata"> 17541cb0ef41Sopenharmony_ci<span>Added in: v6.0.0</span> 17551cb0ef41Sopenharmony_ci</div> 17561cb0ef41Sopenharmony_ci<p>Print stack traces for process warnings (including deprecations).</p> 17571cb0ef41Sopenharmony_ci<h4><code>--track-heap-objects</code><span><a class="mark" href="#--track-heap-objects" id="--track-heap-objects">#</a></span><a aria-hidden="true" class="legacy" id="cli_track_heap_objects"></a></h4> 17581cb0ef41Sopenharmony_ci<div class="api_metadata"> 17591cb0ef41Sopenharmony_ci<span>Added in: v2.4.0</span> 17601cb0ef41Sopenharmony_ci</div> 17611cb0ef41Sopenharmony_ci<p>Track heap object allocations for heap snapshots.</p> 17621cb0ef41Sopenharmony_ci<h4><code>--unhandled-rejections=mode</code><span><a class="mark" href="#--unhandled-rejectionsmode" id="--unhandled-rejectionsmode">#</a></span><a aria-hidden="true" class="legacy" id="cli_unhandled_rejections_mode"></a></h4> 17631cb0ef41Sopenharmony_ci<div class="api_metadata"> 17641cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 17651cb0ef41Sopenharmony_ci<table> 17661cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 17671cb0ef41Sopenharmony_ci<tr><td>v15.0.0</td> 17681cb0ef41Sopenharmony_ci<td><p>Changed default mode to <code>throw</code>. Previously, a warning was emitted.</p></td></tr> 17691cb0ef41Sopenharmony_ci<tr><td>v12.0.0, v10.17.0</td> 17701cb0ef41Sopenharmony_ci<td><p><span>Added in: v12.0.0, v10.17.0</span></p></td></tr> 17711cb0ef41Sopenharmony_ci</tbody></table> 17721cb0ef41Sopenharmony_ci</details> 17731cb0ef41Sopenharmony_ci</div> 17741cb0ef41Sopenharmony_ci<p>Using this flag allows to change what should happen when an unhandled rejection 17751cb0ef41Sopenharmony_cioccurs. One of the following modes can be chosen:</p> 17761cb0ef41Sopenharmony_ci<ul> 17771cb0ef41Sopenharmony_ci<li><code>throw</code>: Emit <a href="process.html#event-unhandledrejection"><code>unhandledRejection</code></a>. If this hook is not set, raise the 17781cb0ef41Sopenharmony_ciunhandled rejection as an uncaught exception. This is the default.</li> 17791cb0ef41Sopenharmony_ci<li><code>strict</code>: Raise the unhandled rejection as an uncaught exception. If the 17801cb0ef41Sopenharmony_ciexception is handled, <a href="process.html#event-unhandledrejection"><code>unhandledRejection</code></a> is emitted.</li> 17811cb0ef41Sopenharmony_ci<li><code>warn</code>: Always trigger a warning, no matter if the <a href="process.html#event-unhandledrejection"><code>unhandledRejection</code></a> 17821cb0ef41Sopenharmony_cihook is set or not but do not print the deprecation warning.</li> 17831cb0ef41Sopenharmony_ci<li><code>warn-with-error-code</code>: Emit <a href="process.html#event-unhandledrejection"><code>unhandledRejection</code></a>. If this hook is not 17841cb0ef41Sopenharmony_ciset, trigger a warning, and set the process exit code to 1.</li> 17851cb0ef41Sopenharmony_ci<li><code>none</code>: Silence all warnings.</li> 17861cb0ef41Sopenharmony_ci</ul> 17871cb0ef41Sopenharmony_ci<p>If a rejection happens during the command line entry point's ES module static 17881cb0ef41Sopenharmony_ciloading phase, it will always raise it as an uncaught exception.</p> 17891cb0ef41Sopenharmony_ci<h4><code>--use-bundled-ca</code>, <code>--use-openssl-ca</code><span><a class="mark" href="#--use-bundled-ca---use-openssl-ca" id="--use-bundled-ca---use-openssl-ca">#</a></span><a aria-hidden="true" class="legacy" id="cli_use_bundled_ca_use_openssl_ca"></a></h4> 17901cb0ef41Sopenharmony_ci<div class="api_metadata"> 17911cb0ef41Sopenharmony_ci<span>Added in: v6.11.0</span> 17921cb0ef41Sopenharmony_ci</div> 17931cb0ef41Sopenharmony_ci<p>Use bundled Mozilla CA store as supplied by current Node.js version 17941cb0ef41Sopenharmony_cior use OpenSSL's default CA store. The default store is selectable 17951cb0ef41Sopenharmony_ciat build-time.</p> 17961cb0ef41Sopenharmony_ci<p>The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store 17971cb0ef41Sopenharmony_cithat is fixed at release time. It is identical on all supported platforms.</p> 17981cb0ef41Sopenharmony_ci<p>Using OpenSSL store allows for external modifications of the store. For most 17991cb0ef41Sopenharmony_ciLinux and BSD distributions, this store is maintained by the distribution 18001cb0ef41Sopenharmony_cimaintainers and system administrators. OpenSSL CA store location is dependent on 18011cb0ef41Sopenharmony_ciconfiguration of the OpenSSL library but this can be altered at runtime using 18021cb0ef41Sopenharmony_cienvironment variables.</p> 18031cb0ef41Sopenharmony_ci<p>See <code>SSL_CERT_DIR</code> and <code>SSL_CERT_FILE</code>.</p> 18041cb0ef41Sopenharmony_ci<h4><code>--use-largepages=mode</code><span><a class="mark" href="#--use-largepagesmode" id="--use-largepagesmode">#</a></span><a aria-hidden="true" class="legacy" id="cli_use_largepages_mode"></a></h4> 18051cb0ef41Sopenharmony_ci<div class="api_metadata"> 18061cb0ef41Sopenharmony_ci<span>Added in: v13.6.0, v12.17.0</span> 18071cb0ef41Sopenharmony_ci</div> 18081cb0ef41Sopenharmony_ci<p>Re-map the Node.js static code to large memory pages at startup. If supported on 18091cb0ef41Sopenharmony_cithe target system, this will cause the Node.js static code to be moved onto 2 18101cb0ef41Sopenharmony_ciMiB pages instead of 4 KiB pages.</p> 18111cb0ef41Sopenharmony_ci<p>The following values are valid for <code>mode</code>:</p> 18121cb0ef41Sopenharmony_ci<ul> 18131cb0ef41Sopenharmony_ci<li><code>off</code>: No mapping will be attempted. This is the default.</li> 18141cb0ef41Sopenharmony_ci<li><code>on</code>: If supported by the OS, mapping will be attempted. Failure to map will 18151cb0ef41Sopenharmony_cibe ignored and a message will be printed to standard error.</li> 18161cb0ef41Sopenharmony_ci<li><code>silent</code>: If supported by the OS, mapping will be attempted. Failure to map 18171cb0ef41Sopenharmony_ciwill be ignored and will not be reported.</li> 18181cb0ef41Sopenharmony_ci</ul> 18191cb0ef41Sopenharmony_ci<h4><code>--v8-options</code><span><a class="mark" href="#--v8-options" id="--v8-options">#</a></span><a aria-hidden="true" class="legacy" id="cli_v8_options"></a></h4> 18201cb0ef41Sopenharmony_ci<div class="api_metadata"> 18211cb0ef41Sopenharmony_ci<span>Added in: v0.1.3</span> 18221cb0ef41Sopenharmony_ci</div> 18231cb0ef41Sopenharmony_ci<p>Print V8 command-line options.</p> 18241cb0ef41Sopenharmony_ci<h4><code>--v8-pool-size=num</code><span><a class="mark" href="#--v8-pool-sizenum" id="--v8-pool-sizenum">#</a></span><a aria-hidden="true" class="legacy" id="cli_v8_pool_size_num"></a></h4> 18251cb0ef41Sopenharmony_ci<div class="api_metadata"> 18261cb0ef41Sopenharmony_ci<span>Added in: v5.10.0</span> 18271cb0ef41Sopenharmony_ci</div> 18281cb0ef41Sopenharmony_ci<p>Set V8's thread pool size which will be used to allocate background jobs.</p> 18291cb0ef41Sopenharmony_ci<p>If set to <code>0</code> then Node.js will choose an appropriate size of the thread pool 18301cb0ef41Sopenharmony_cibased on an estimate of the amount of parallelism.</p> 18311cb0ef41Sopenharmony_ci<p>The amount of parallelism refers to the number of computations that can be 18321cb0ef41Sopenharmony_cicarried out simultaneously in a given machine. In general, it's the same as the 18331cb0ef41Sopenharmony_ciamount of CPUs, but it may diverge in environments such as VMs or containers.</p> 18341cb0ef41Sopenharmony_ci<h4><code>--watch</code><span><a class="mark" href="#--watch" id="--watch">#</a></span><a aria-hidden="true" class="legacy" id="cli_watch"></a></h4> 18351cb0ef41Sopenharmony_ci<div class="api_metadata"> 18361cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 18371cb0ef41Sopenharmony_ci<table> 18381cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 18391cb0ef41Sopenharmony_ci<tr><td>v18.13.0</td> 18401cb0ef41Sopenharmony_ci<td><p>Test runner now supports running in watch mode.</p></td></tr> 18411cb0ef41Sopenharmony_ci<tr><td>v18.11.0</td> 18421cb0ef41Sopenharmony_ci<td><p><span>Added in: v18.11.0</span></p></td></tr> 18431cb0ef41Sopenharmony_ci</tbody></table> 18441cb0ef41Sopenharmony_ci</details> 18451cb0ef41Sopenharmony_ci</div> 18461cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 18471cb0ef41Sopenharmony_ci<p>Starts Node.js in watch mode. 18481cb0ef41Sopenharmony_ciWhen in watch mode, changes in the watched files cause the Node.js process to 18491cb0ef41Sopenharmony_cirestart. 18501cb0ef41Sopenharmony_ciBy default, watch mode will watch the entry point 18511cb0ef41Sopenharmony_ciand any required or imported module. 18521cb0ef41Sopenharmony_ciUse <code>--watch-path</code> to specify what paths to watch.</p> 18531cb0ef41Sopenharmony_ci<p>This flag cannot be combined with 18541cb0ef41Sopenharmony_ci<code>--check</code>, <code>--eval</code>, <code>--interactive</code>, or the REPL.</p> 18551cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --watch index.js</span></code> <button class="copy-button">copy</button></pre> 18561cb0ef41Sopenharmony_ci<h4><code>--watch-path</code><span><a class="mark" href="#--watch-path" id="--watch-path">#</a></span><a aria-hidden="true" class="legacy" id="cli_watch_path"></a></h4> 18571cb0ef41Sopenharmony_ci<div class="api_metadata"> 18581cb0ef41Sopenharmony_ci<span>Added in: v18.11.0</span> 18591cb0ef41Sopenharmony_ci</div> 18601cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 18611cb0ef41Sopenharmony_ci<p>Starts Node.js in watch mode and specifies what paths to watch. 18621cb0ef41Sopenharmony_ciWhen in watch mode, changes in the watched paths cause the Node.js process to 18631cb0ef41Sopenharmony_cirestart. 18641cb0ef41Sopenharmony_ciThis will turn off watching of required or imported modules, even when used in 18651cb0ef41Sopenharmony_cicombination with <code>--watch</code>.</p> 18661cb0ef41Sopenharmony_ci<p>This flag cannot be combined with 18671cb0ef41Sopenharmony_ci<code>--check</code>, <code>--eval</code>, <code>--interactive</code>, <code>--test</code>, or the REPL.</p> 18681cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --watch-path=./src --watch-path=./tests index.js</span></code> <button class="copy-button">copy</button></pre> 18691cb0ef41Sopenharmony_ci<p>This option is only supported on macOS and Windows. 18701cb0ef41Sopenharmony_ciAn <code>ERR_FEATURE_UNAVAILABLE_ON_PLATFORM</code> exception will be thrown 18711cb0ef41Sopenharmony_ciwhen the option is used on a platform that does not support it.</p> 18721cb0ef41Sopenharmony_ci<h4><code>--watch-preserve-output</code><span><a class="mark" href="#--watch-preserve-output" id="--watch-preserve-output">#</a></span><a aria-hidden="true" class="legacy" id="cli_watch_preserve_output"></a></h4> 18731cb0ef41Sopenharmony_ci<p>Disable the clearing of the console when watch mode restarts the process.</p> 18741cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --watch --watch-preserve-output test.js</span></code> <button class="copy-button">copy</button></pre> 18751cb0ef41Sopenharmony_ci<h4><code>--zero-fill-buffers</code><span><a class="mark" href="#--zero-fill-buffers" id="--zero-fill-buffers">#</a></span><a aria-hidden="true" class="legacy" id="cli_zero_fill_buffers"></a></h4> 18761cb0ef41Sopenharmony_ci<div class="api_metadata"> 18771cb0ef41Sopenharmony_ci<span>Added in: v6.0.0</span> 18781cb0ef41Sopenharmony_ci</div> 18791cb0ef41Sopenharmony_ci<p>Automatically zero-fills all newly allocated <a href="buffer.html#class-buffer"><code>Buffer</code></a> and <a href="buffer.html#class-slowbuffer"><code>SlowBuffer</code></a> 18801cb0ef41Sopenharmony_ciinstances.</p> 18811cb0ef41Sopenharmony_ci<h4><code>-c</code>, <code>--check</code><span><a class="mark" href="#-c---check" id="-c---check">#</a></span><a aria-hidden="true" class="legacy" id="cli_c_check"></a></h4> 18821cb0ef41Sopenharmony_ci<div class="api_metadata"> 18831cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 18841cb0ef41Sopenharmony_ci<table> 18851cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 18861cb0ef41Sopenharmony_ci<tr><td>v10.0.0</td> 18871cb0ef41Sopenharmony_ci<td><p>The <code>--require</code> option is now supported when checking a file.</p></td></tr> 18881cb0ef41Sopenharmony_ci<tr><td>v5.0.0, v4.2.0</td> 18891cb0ef41Sopenharmony_ci<td><p><span>Added in: v5.0.0, v4.2.0</span></p></td></tr> 18901cb0ef41Sopenharmony_ci</tbody></table> 18911cb0ef41Sopenharmony_ci</details> 18921cb0ef41Sopenharmony_ci</div> 18931cb0ef41Sopenharmony_ci<p>Syntax check the script without executing.</p> 18941cb0ef41Sopenharmony_ci<h4><code>-e</code>, <code>--eval "script"</code><span><a class="mark" href="#-e---eval-script" id="-e---eval-script">#</a></span><a aria-hidden="true" class="legacy" id="cli_e_eval_script"></a></h4> 18951cb0ef41Sopenharmony_ci<div class="api_metadata"> 18961cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 18971cb0ef41Sopenharmony_ci<table> 18981cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 18991cb0ef41Sopenharmony_ci<tr><td>v5.11.0</td> 19001cb0ef41Sopenharmony_ci<td><p>Built-in libraries are now available as predefined variables.</p></td></tr> 19011cb0ef41Sopenharmony_ci<tr><td>v0.5.2</td> 19021cb0ef41Sopenharmony_ci<td><p><span>Added in: v0.5.2</span></p></td></tr> 19031cb0ef41Sopenharmony_ci</tbody></table> 19041cb0ef41Sopenharmony_ci</details> 19051cb0ef41Sopenharmony_ci</div> 19061cb0ef41Sopenharmony_ci<p>Evaluate the following argument as JavaScript. The modules which are 19071cb0ef41Sopenharmony_cipredefined in the REPL can also be used in <code>script</code>.</p> 19081cb0ef41Sopenharmony_ci<p>On Windows, using <code>cmd.exe</code> a single quote will not work correctly because it 19091cb0ef41Sopenharmony_cionly recognizes double <code>"</code> for quoting. In Powershell or Git bash, both <code>'</code> 19101cb0ef41Sopenharmony_ciand <code>"</code> are usable.</p> 19111cb0ef41Sopenharmony_ci<h4><code>-h</code>, <code>--help</code><span><a class="mark" href="#-h---help" id="-h---help">#</a></span><a aria-hidden="true" class="legacy" id="cli_h_help"></a></h4> 19121cb0ef41Sopenharmony_ci<div class="api_metadata"> 19131cb0ef41Sopenharmony_ci<span>Added in: v0.1.3</span> 19141cb0ef41Sopenharmony_ci</div> 19151cb0ef41Sopenharmony_ci<p>Print node command-line options. 19161cb0ef41Sopenharmony_ciThe output of this option is less detailed than this document.</p> 19171cb0ef41Sopenharmony_ci<h4><code>-i</code>, <code>--interactive</code><span><a class="mark" href="#-i---interactive" id="-i---interactive">#</a></span><a aria-hidden="true" class="legacy" id="cli_i_interactive"></a></h4> 19181cb0ef41Sopenharmony_ci<div class="api_metadata"> 19191cb0ef41Sopenharmony_ci<span>Added in: v0.7.7</span> 19201cb0ef41Sopenharmony_ci</div> 19211cb0ef41Sopenharmony_ci<p>Opens the REPL even if stdin does not appear to be a terminal.</p> 19221cb0ef41Sopenharmony_ci<h4><code>-p</code>, <code>--print "script"</code><span><a class="mark" href="#-p---print-script" id="-p---print-script">#</a></span><a aria-hidden="true" class="legacy" id="cli_p_print_script"></a></h4> 19231cb0ef41Sopenharmony_ci<div class="api_metadata"> 19241cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 19251cb0ef41Sopenharmony_ci<table> 19261cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 19271cb0ef41Sopenharmony_ci<tr><td>v5.11.0</td> 19281cb0ef41Sopenharmony_ci<td><p>Built-in libraries are now available as predefined variables.</p></td></tr> 19291cb0ef41Sopenharmony_ci<tr><td>v0.6.4</td> 19301cb0ef41Sopenharmony_ci<td><p><span>Added in: v0.6.4</span></p></td></tr> 19311cb0ef41Sopenharmony_ci</tbody></table> 19321cb0ef41Sopenharmony_ci</details> 19331cb0ef41Sopenharmony_ci</div> 19341cb0ef41Sopenharmony_ci<p>Identical to <code>-e</code> but prints the result.</p> 19351cb0ef41Sopenharmony_ci<h4><code>-r</code>, <code>--require module</code><span><a class="mark" href="#-r---require-module" id="-r---require-module">#</a></span><a aria-hidden="true" class="legacy" id="cli_r_require_module"></a></h4> 19361cb0ef41Sopenharmony_ci<div class="api_metadata"> 19371cb0ef41Sopenharmony_ci<span>Added in: v1.6.0</span> 19381cb0ef41Sopenharmony_ci</div> 19391cb0ef41Sopenharmony_ci<p>Preload the specified module at startup.</p> 19401cb0ef41Sopenharmony_ci<p>Follows <code>require()</code>'s module resolution 19411cb0ef41Sopenharmony_cirules. <code>module</code> may be either a path to a file, or a node module name.</p> 19421cb0ef41Sopenharmony_ci<p>Only CommonJS modules are supported. 19431cb0ef41Sopenharmony_ciUse <a href="#--importmodule"><code>--import</code></a> to preload an <a href="esm.html#modules-ecmascript-modules">ECMAScript module</a>. 19441cb0ef41Sopenharmony_ciModules preloaded with <code>--require</code> will run before modules preloaded with <code>--import</code>.</p> 19451cb0ef41Sopenharmony_ci<h4><code>-v</code>, <code>--version</code><span><a class="mark" href="#-v---version" id="-v---version">#</a></span><a aria-hidden="true" class="legacy" id="cli_v_version"></a></h4> 19461cb0ef41Sopenharmony_ci<div class="api_metadata"> 19471cb0ef41Sopenharmony_ci<span>Added in: v0.1.3</span> 19481cb0ef41Sopenharmony_ci</div> 19491cb0ef41Sopenharmony_ci<p>Print node's version.</p> 19501cb0ef41Sopenharmony_ci</section><section><h3>Environment variables<span><a class="mark" href="#environment-variables" id="environment-variables">#</a></span><a aria-hidden="true" class="legacy" id="cli_environment_variables"></a></h3> 19511cb0ef41Sopenharmony_ci<h4><code>FORCE_COLOR=[1, 2, 3]</code><span><a class="mark" href="#force_color1-2-3" id="force_color1-2-3">#</a></span><a aria-hidden="true" class="legacy" id="cli_force_color_1_2_3"></a></h4> 19521cb0ef41Sopenharmony_ci<p>The <code>FORCE_COLOR</code> environment variable is used to 19531cb0ef41Sopenharmony_cienable ANSI colorized output. The value may be:</p> 19541cb0ef41Sopenharmony_ci<ul> 19551cb0ef41Sopenharmony_ci<li><code>1</code>, <code>true</code>, or the empty string <code>''</code> indicate 16-color support,</li> 19561cb0ef41Sopenharmony_ci<li><code>2</code> to indicate 256-color support, or</li> 19571cb0ef41Sopenharmony_ci<li><code>3</code> to indicate 16 million-color support.</li> 19581cb0ef41Sopenharmony_ci</ul> 19591cb0ef41Sopenharmony_ci<p>When <code>FORCE_COLOR</code> is used and set to a supported value, both the <code>NO_COLOR</code>, 19601cb0ef41Sopenharmony_ciand <code>NODE_DISABLE_COLORS</code> environment variables are ignored.</p> 19611cb0ef41Sopenharmony_ci<p>Any other value will result in colorized output being disabled.</p> 19621cb0ef41Sopenharmony_ci<h4><code>NODE_DEBUG=module[,…]</code><span><a class="mark" href="#node_debugmodule" id="node_debugmodule">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_debug_module"></a></h4> 19631cb0ef41Sopenharmony_ci<div class="api_metadata"> 19641cb0ef41Sopenharmony_ci<span>Added in: v0.1.32</span> 19651cb0ef41Sopenharmony_ci</div> 19661cb0ef41Sopenharmony_ci<p><code>','</code>-separated list of core modules that should print debug information.</p> 19671cb0ef41Sopenharmony_ci<h4><code>NODE_DEBUG_NATIVE=module[,…]</code><span><a class="mark" href="#node_debug_nativemodule" id="node_debug_nativemodule">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_debug_native_module"></a></h4> 19681cb0ef41Sopenharmony_ci<p><code>','</code>-separated list of core C++ modules that should print debug information.</p> 19691cb0ef41Sopenharmony_ci<h4><code>NODE_DISABLE_COLORS=1</code><span><a class="mark" href="#node_disable_colors1" id="node_disable_colors1">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_disable_colors_1"></a></h4> 19701cb0ef41Sopenharmony_ci<div class="api_metadata"> 19711cb0ef41Sopenharmony_ci<span>Added in: v0.3.0</span> 19721cb0ef41Sopenharmony_ci</div> 19731cb0ef41Sopenharmony_ci<p>When set, colors will not be used in the REPL.</p> 19741cb0ef41Sopenharmony_ci<h4><code>NODE_EXTRA_CA_CERTS=file</code><span><a class="mark" href="#node_extra_ca_certsfile" id="node_extra_ca_certsfile">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_extra_ca_certs_file"></a></h4> 19751cb0ef41Sopenharmony_ci<div class="api_metadata"> 19761cb0ef41Sopenharmony_ci<span>Added in: v7.3.0</span> 19771cb0ef41Sopenharmony_ci</div> 19781cb0ef41Sopenharmony_ci<p>When set, the well known "root" CAs (like VeriSign) will be extended with the 19791cb0ef41Sopenharmony_ciextra certificates in <code>file</code>. The file should consist of one or more trusted 19801cb0ef41Sopenharmony_cicertificates in PEM format. A message will be emitted (once) with 19811cb0ef41Sopenharmony_ci<a href="process.html#processemitwarningwarning-options"><code>process.emitWarning()</code></a> if the file is missing or 19821cb0ef41Sopenharmony_cimalformed, but any errors are otherwise ignored.</p> 19831cb0ef41Sopenharmony_ci<p>Neither the well known nor extra certificates are used when the <code>ca</code> 19841cb0ef41Sopenharmony_cioptions property is explicitly specified for a TLS or HTTPS client or server.</p> 19851cb0ef41Sopenharmony_ci<p>This environment variable is ignored when <code>node</code> runs as setuid root or 19861cb0ef41Sopenharmony_cihas Linux file capabilities set.</p> 19871cb0ef41Sopenharmony_ci<p>The <code>NODE_EXTRA_CA_CERTS</code> environment variable is only read when the Node.js 19881cb0ef41Sopenharmony_ciprocess is first launched. Changing the value at runtime using 19891cb0ef41Sopenharmony_ci<code>process.env.NODE_EXTRA_CA_CERTS</code> has no effect on the current process.</p> 19901cb0ef41Sopenharmony_ci<h4><code>NODE_ICU_DATA=file</code><span><a class="mark" href="#node_icu_datafile" id="node_icu_datafile">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_icu_data_file"></a></h4> 19911cb0ef41Sopenharmony_ci<div class="api_metadata"> 19921cb0ef41Sopenharmony_ci<span>Added in: v0.11.15</span> 19931cb0ef41Sopenharmony_ci</div> 19941cb0ef41Sopenharmony_ci<p>Data path for ICU (<code>Intl</code> object) data. Will extend linked-in data when compiled 19951cb0ef41Sopenharmony_ciwith small-icu support.</p> 19961cb0ef41Sopenharmony_ci<h4><code>NODE_NO_WARNINGS=1</code><span><a class="mark" href="#node_no_warnings1" id="node_no_warnings1">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_no_warnings_1"></a></h4> 19971cb0ef41Sopenharmony_ci<div class="api_metadata"> 19981cb0ef41Sopenharmony_ci<span>Added in: v6.11.0</span> 19991cb0ef41Sopenharmony_ci</div> 20001cb0ef41Sopenharmony_ci<p>When set to <code>1</code>, process warnings are silenced.</p> 20011cb0ef41Sopenharmony_ci<h4><code>NODE_OPTIONS=options...</code><span><a class="mark" href="#node_optionsoptions" id="node_optionsoptions">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_options_options"></a></h4> 20021cb0ef41Sopenharmony_ci<div class="api_metadata"> 20031cb0ef41Sopenharmony_ci<span>Added in: v8.0.0</span> 20041cb0ef41Sopenharmony_ci</div> 20051cb0ef41Sopenharmony_ci<p>A space-separated list of command-line options. <code>options...</code> are interpreted 20061cb0ef41Sopenharmony_cibefore command-line options, so command-line options will override or 20071cb0ef41Sopenharmony_cicompound after anything in <code>options...</code>. Node.js will exit with an error if 20081cb0ef41Sopenharmony_cian option that is not allowed in the environment is used, such as <code>-p</code> or a 20091cb0ef41Sopenharmony_ciscript file.</p> 20101cb0ef41Sopenharmony_ci<p>If an option value contains a space, it can be escaped using double quotes:</p> 20111cb0ef41Sopenharmony_ci<pre><code class="language-bash">NODE_OPTIONS=<span class="hljs-string">'--require "./my path/file.js"'</span></code> <button class="copy-button">copy</button></pre> 20121cb0ef41Sopenharmony_ci<p>A singleton flag passed as a command-line option will override the same flag 20131cb0ef41Sopenharmony_cipassed into <code>NODE_OPTIONS</code>:</p> 20141cb0ef41Sopenharmony_ci<pre><code class="language-bash"><span class="hljs-comment"># The inspector will be available on port 5555</span> 20151cb0ef41Sopenharmony_ciNODE_OPTIONS=<span class="hljs-string">'--inspect=localhost:4444'</span> node --inspect=localhost:5555</code> <button class="copy-button">copy</button></pre> 20161cb0ef41Sopenharmony_ci<p>A flag that can be passed multiple times will be treated as if its 20171cb0ef41Sopenharmony_ci<code>NODE_OPTIONS</code> instances were passed first, and then its command-line 20181cb0ef41Sopenharmony_ciinstances afterwards:</p> 20191cb0ef41Sopenharmony_ci<pre><code class="language-bash">NODE_OPTIONS=<span class="hljs-string">'--require "./a.js"'</span> node --require <span class="hljs-string">"./b.js"</span> 20201cb0ef41Sopenharmony_ci<span class="hljs-comment"># is equivalent to:</span> 20211cb0ef41Sopenharmony_cinode --require <span class="hljs-string">"./a.js"</span> --require <span class="hljs-string">"./b.js"</span></code> <button class="copy-button">copy</button></pre> 20221cb0ef41Sopenharmony_ci<p>Node.js options that are allowed are:</p> 20231cb0ef41Sopenharmony_ci<!-- node-options-node start --> 20241cb0ef41Sopenharmony_ci<ul> 20251cb0ef41Sopenharmony_ci<li><code>--conditions</code>, <code>-C</code></li> 20261cb0ef41Sopenharmony_ci<li><code>--diagnostic-dir</code></li> 20271cb0ef41Sopenharmony_ci<li><code>--disable-proto</code></li> 20281cb0ef41Sopenharmony_ci<li><code>--dns-result-order</code></li> 20291cb0ef41Sopenharmony_ci<li><code>--enable-fips</code></li> 20301cb0ef41Sopenharmony_ci<li><code>--enable-network-family-autoselection</code></li> 20311cb0ef41Sopenharmony_ci<li><code>--enable-source-maps</code></li> 20321cb0ef41Sopenharmony_ci<li><code>--experimental-abortcontroller</code></li> 20331cb0ef41Sopenharmony_ci<li><code>--experimental-default-type</code></li> 20341cb0ef41Sopenharmony_ci<li><code>--experimental-global-customevent</code></li> 20351cb0ef41Sopenharmony_ci<li><code>--experimental-global-webcrypto</code></li> 20361cb0ef41Sopenharmony_ci<li><code>--experimental-import-meta-resolve</code></li> 20371cb0ef41Sopenharmony_ci<li><code>--experimental-json-modules</code></li> 20381cb0ef41Sopenharmony_ci<li><code>--experimental-loader</code></li> 20391cb0ef41Sopenharmony_ci<li><code>--experimental-modules</code></li> 20401cb0ef41Sopenharmony_ci<li><code>--experimental-network-imports</code></li> 20411cb0ef41Sopenharmony_ci<li><code>--experimental-policy</code></li> 20421cb0ef41Sopenharmony_ci<li><code>--experimental-shadow-realm</code></li> 20431cb0ef41Sopenharmony_ci<li><code>--experimental-specifier-resolution</code></li> 20441cb0ef41Sopenharmony_ci<li><code>--experimental-top-level-await</code></li> 20451cb0ef41Sopenharmony_ci<li><code>--experimental-vm-modules</code></li> 20461cb0ef41Sopenharmony_ci<li><code>--experimental-wasi-unstable-preview1</code></li> 20471cb0ef41Sopenharmony_ci<li><code>--experimental-wasm-modules</code></li> 20481cb0ef41Sopenharmony_ci<li><code>--force-context-aware</code></li> 20491cb0ef41Sopenharmony_ci<li><code>--force-fips</code></li> 20501cb0ef41Sopenharmony_ci<li><code>--force-node-api-uncaught-exceptions-policy</code></li> 20511cb0ef41Sopenharmony_ci<li><code>--frozen-intrinsics</code></li> 20521cb0ef41Sopenharmony_ci<li><code>--heapsnapshot-near-heap-limit</code></li> 20531cb0ef41Sopenharmony_ci<li><code>--heapsnapshot-signal</code></li> 20541cb0ef41Sopenharmony_ci<li><code>--http-parser</code></li> 20551cb0ef41Sopenharmony_ci<li><code>--icu-data-dir</code></li> 20561cb0ef41Sopenharmony_ci<li><code>--import</code></li> 20571cb0ef41Sopenharmony_ci<li><code>--input-type</code></li> 20581cb0ef41Sopenharmony_ci<li><code>--insecure-http-parser</code></li> 20591cb0ef41Sopenharmony_ci<li><code>--inspect-brk</code></li> 20601cb0ef41Sopenharmony_ci<li><code>--inspect-port</code>, <code>--debug-port</code></li> 20611cb0ef41Sopenharmony_ci<li><code>--inspect-publish-uid</code></li> 20621cb0ef41Sopenharmony_ci<li><code>--inspect</code></li> 20631cb0ef41Sopenharmony_ci<li><code>--max-http-header-size</code></li> 20641cb0ef41Sopenharmony_ci<li><code>--napi-modules</code></li> 20651cb0ef41Sopenharmony_ci<li><code>--no-addons</code></li> 20661cb0ef41Sopenharmony_ci<li><code>--no-deprecation</code></li> 20671cb0ef41Sopenharmony_ci<li><code>--no-experimental-fetch</code></li> 20681cb0ef41Sopenharmony_ci<li><code>--no-experimental-repl-await</code></li> 20691cb0ef41Sopenharmony_ci<li><code>--no-extra-info-on-fatal-exception</code></li> 20701cb0ef41Sopenharmony_ci<li><code>--no-force-async-hooks-checks</code></li> 20711cb0ef41Sopenharmony_ci<li><code>--no-global-search-paths</code></li> 20721cb0ef41Sopenharmony_ci<li><code>--no-warnings</code></li> 20731cb0ef41Sopenharmony_ci<li><code>--node-memory-debug</code></li> 20741cb0ef41Sopenharmony_ci<li><code>--openssl-config</code></li> 20751cb0ef41Sopenharmony_ci<li><code>--openssl-legacy-provider</code></li> 20761cb0ef41Sopenharmony_ci<li><code>--openssl-shared-config</code></li> 20771cb0ef41Sopenharmony_ci<li><code>--pending-deprecation</code></li> 20781cb0ef41Sopenharmony_ci<li><code>--policy-integrity</code></li> 20791cb0ef41Sopenharmony_ci<li><code>--preserve-symlinks-main</code></li> 20801cb0ef41Sopenharmony_ci<li><code>--preserve-symlinks</code></li> 20811cb0ef41Sopenharmony_ci<li><code>--prof-process</code></li> 20821cb0ef41Sopenharmony_ci<li><code>--redirect-warnings</code></li> 20831cb0ef41Sopenharmony_ci<li><code>--report-compact</code></li> 20841cb0ef41Sopenharmony_ci<li><code>--report-dir</code>, <code>--report-directory</code></li> 20851cb0ef41Sopenharmony_ci<li><code>--report-filename</code></li> 20861cb0ef41Sopenharmony_ci<li><code>--report-on-fatalerror</code></li> 20871cb0ef41Sopenharmony_ci<li><code>--report-on-signal</code></li> 20881cb0ef41Sopenharmony_ci<li><code>--report-signal</code></li> 20891cb0ef41Sopenharmony_ci<li><code>--report-uncaught-exception</code></li> 20901cb0ef41Sopenharmony_ci<li><code>--require</code>, <code>-r</code></li> 20911cb0ef41Sopenharmony_ci<li><code>--secure-heap-min</code></li> 20921cb0ef41Sopenharmony_ci<li><code>--secure-heap</code></li> 20931cb0ef41Sopenharmony_ci<li><code>--snapshot-blob</code></li> 20941cb0ef41Sopenharmony_ci<li><code>--test-only</code></li> 20951cb0ef41Sopenharmony_ci<li><code>--test-reporter-destination</code></li> 20961cb0ef41Sopenharmony_ci<li><code>--test-reporter</code></li> 20971cb0ef41Sopenharmony_ci<li><code>--test-shard</code></li> 20981cb0ef41Sopenharmony_ci<li><code>--throw-deprecation</code></li> 20991cb0ef41Sopenharmony_ci<li><code>--title</code></li> 21001cb0ef41Sopenharmony_ci<li><code>--tls-cipher-list</code></li> 21011cb0ef41Sopenharmony_ci<li><code>--tls-keylog</code></li> 21021cb0ef41Sopenharmony_ci<li><code>--tls-max-v1.2</code></li> 21031cb0ef41Sopenharmony_ci<li><code>--tls-max-v1.3</code></li> 21041cb0ef41Sopenharmony_ci<li><code>--tls-min-v1.0</code></li> 21051cb0ef41Sopenharmony_ci<li><code>--tls-min-v1.1</code></li> 21061cb0ef41Sopenharmony_ci<li><code>--tls-min-v1.2</code></li> 21071cb0ef41Sopenharmony_ci<li><code>--tls-min-v1.3</code></li> 21081cb0ef41Sopenharmony_ci<li><code>--trace-atomics-wait</code></li> 21091cb0ef41Sopenharmony_ci<li><code>--trace-deprecation</code></li> 21101cb0ef41Sopenharmony_ci<li><code>--trace-event-categories</code></li> 21111cb0ef41Sopenharmony_ci<li><code>--trace-event-file-pattern</code></li> 21121cb0ef41Sopenharmony_ci<li><code>--trace-events-enabled</code></li> 21131cb0ef41Sopenharmony_ci<li><code>--trace-exit</code></li> 21141cb0ef41Sopenharmony_ci<li><code>--trace-sigint</code></li> 21151cb0ef41Sopenharmony_ci<li><code>--trace-sync-io</code></li> 21161cb0ef41Sopenharmony_ci<li><code>--trace-tls</code></li> 21171cb0ef41Sopenharmony_ci<li><code>--trace-uncaught</code></li> 21181cb0ef41Sopenharmony_ci<li><code>--trace-warnings</code></li> 21191cb0ef41Sopenharmony_ci<li><code>--track-heap-objects</code></li> 21201cb0ef41Sopenharmony_ci<li><code>--unhandled-rejections</code></li> 21211cb0ef41Sopenharmony_ci<li><code>--use-bundled-ca</code></li> 21221cb0ef41Sopenharmony_ci<li><code>--use-largepages</code></li> 21231cb0ef41Sopenharmony_ci<li><code>--use-openssl-ca</code></li> 21241cb0ef41Sopenharmony_ci<li><code>--v8-pool-size</code></li> 21251cb0ef41Sopenharmony_ci<li><code>--watch-path</code></li> 21261cb0ef41Sopenharmony_ci<li><code>--watch-preserve-output</code></li> 21271cb0ef41Sopenharmony_ci<li><code>--watch</code></li> 21281cb0ef41Sopenharmony_ci<li><code>--zero-fill-buffers</code></li> 21291cb0ef41Sopenharmony_ci</ul> 21301cb0ef41Sopenharmony_ci<!-- node-options-node end --> 21311cb0ef41Sopenharmony_ci<p>V8 options that are allowed are:</p> 21321cb0ef41Sopenharmony_ci<!-- node-options-v8 start --> 21331cb0ef41Sopenharmony_ci<ul> 21341cb0ef41Sopenharmony_ci<li><code>--abort-on-uncaught-exception</code></li> 21351cb0ef41Sopenharmony_ci<li><code>--disallow-code-generation-from-strings</code></li> 21361cb0ef41Sopenharmony_ci<li><code>--enable-etw-stack-walking</code></li> 21371cb0ef41Sopenharmony_ci<li><code>--huge-max-old-generation-size</code></li> 21381cb0ef41Sopenharmony_ci<li><code>--interpreted-frames-native-stack</code></li> 21391cb0ef41Sopenharmony_ci<li><code>--jitless</code></li> 21401cb0ef41Sopenharmony_ci<li><code>--max-old-space-size</code></li> 21411cb0ef41Sopenharmony_ci<li><code>--max-semi-space-size</code></li> 21421cb0ef41Sopenharmony_ci<li><code>--perf-basic-prof-only-functions</code></li> 21431cb0ef41Sopenharmony_ci<li><code>--perf-basic-prof</code></li> 21441cb0ef41Sopenharmony_ci<li><code>--perf-prof-unwinding-info</code></li> 21451cb0ef41Sopenharmony_ci<li><code>--perf-prof</code></li> 21461cb0ef41Sopenharmony_ci<li><code>--stack-trace-limit</code></li> 21471cb0ef41Sopenharmony_ci</ul> 21481cb0ef41Sopenharmony_ci<!-- node-options-v8 end --> 21491cb0ef41Sopenharmony_ci<p><code>--perf-basic-prof-only-functions</code>, <code>--perf-basic-prof</code>, 21501cb0ef41Sopenharmony_ci<code>--perf-prof-unwinding-info</code>, and <code>--perf-prof</code> are only available on Linux.</p> 21511cb0ef41Sopenharmony_ci<p><code>--enable-etw-stack-walking</code> is only available on Windows.</p> 21521cb0ef41Sopenharmony_ci<h4><code>NODE_PATH=path[:…]</code><span><a class="mark" href="#node_pathpath" id="node_pathpath">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_path_path"></a></h4> 21531cb0ef41Sopenharmony_ci<div class="api_metadata"> 21541cb0ef41Sopenharmony_ci<span>Added in: v0.1.32</span> 21551cb0ef41Sopenharmony_ci</div> 21561cb0ef41Sopenharmony_ci<p><code>':'</code>-separated list of directories prefixed to the module search path.</p> 21571cb0ef41Sopenharmony_ci<p>On Windows, this is a <code>';'</code>-separated list instead.</p> 21581cb0ef41Sopenharmony_ci<h4><code>NODE_PENDING_DEPRECATION=1</code><span><a class="mark" href="#node_pending_deprecation1" id="node_pending_deprecation1">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_pending_deprecation_1"></a></h4> 21591cb0ef41Sopenharmony_ci<div class="api_metadata"> 21601cb0ef41Sopenharmony_ci<span>Added in: v8.0.0</span> 21611cb0ef41Sopenharmony_ci</div> 21621cb0ef41Sopenharmony_ci<p>When set to <code>1</code>, emit pending deprecation warnings.</p> 21631cb0ef41Sopenharmony_ci<p>Pending deprecations are generally identical to a runtime deprecation with the 21641cb0ef41Sopenharmony_cinotable exception that they are turned <em>off</em> by default and will not be emitted 21651cb0ef41Sopenharmony_ciunless either the <code>--pending-deprecation</code> command-line flag, or the 21661cb0ef41Sopenharmony_ci<code>NODE_PENDING_DEPRECATION=1</code> environment variable, is set. Pending deprecations 21671cb0ef41Sopenharmony_ciare used to provide a kind of selective "early warning" mechanism that 21681cb0ef41Sopenharmony_cidevelopers may leverage to detect deprecated API usage.</p> 21691cb0ef41Sopenharmony_ci<h4><code>NODE_PENDING_PIPE_INSTANCES=instances</code><span><a class="mark" href="#node_pending_pipe_instancesinstances" id="node_pending_pipe_instancesinstances">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_pending_pipe_instances_instances"></a></h4> 21701cb0ef41Sopenharmony_ci<p>Set the number of pending pipe instance handles when the pipe server is waiting 21711cb0ef41Sopenharmony_cifor connections. This setting applies to Windows only.</p> 21721cb0ef41Sopenharmony_ci<h4><code>NODE_PRESERVE_SYMLINKS=1</code><span><a class="mark" href="#node_preserve_symlinks1" id="node_preserve_symlinks1">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_preserve_symlinks_1"></a></h4> 21731cb0ef41Sopenharmony_ci<div class="api_metadata"> 21741cb0ef41Sopenharmony_ci<span>Added in: v7.1.0</span> 21751cb0ef41Sopenharmony_ci</div> 21761cb0ef41Sopenharmony_ci<p>When set to <code>1</code>, instructs the module loader to preserve symbolic links when 21771cb0ef41Sopenharmony_ciresolving and caching modules.</p> 21781cb0ef41Sopenharmony_ci<h4><code>NODE_REDIRECT_WARNINGS=file</code><span><a class="mark" href="#node_redirect_warningsfile" id="node_redirect_warningsfile">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_redirect_warnings_file"></a></h4> 21791cb0ef41Sopenharmony_ci<div class="api_metadata"> 21801cb0ef41Sopenharmony_ci<span>Added in: v8.0.0</span> 21811cb0ef41Sopenharmony_ci</div> 21821cb0ef41Sopenharmony_ci<p>When set, process warnings will be emitted to the given file instead of 21831cb0ef41Sopenharmony_ciprinting to stderr. The file will be created if it does not exist, and will be 21841cb0ef41Sopenharmony_ciappended to if it does. If an error occurs while attempting to write the 21851cb0ef41Sopenharmony_ciwarning to the file, the warning will be written to stderr instead. This is 21861cb0ef41Sopenharmony_ciequivalent to using the <code>--redirect-warnings=file</code> command-line flag.</p> 21871cb0ef41Sopenharmony_ci<h4><code>NODE_REPL_HISTORY=file</code><span><a class="mark" href="#node_repl_historyfile" id="node_repl_historyfile">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_repl_history_file"></a></h4> 21881cb0ef41Sopenharmony_ci<div class="api_metadata"> 21891cb0ef41Sopenharmony_ci<span>Added in: v3.0.0</span> 21901cb0ef41Sopenharmony_ci</div> 21911cb0ef41Sopenharmony_ci<p>Path to the file used to store the persistent REPL history. The default path is 21921cb0ef41Sopenharmony_ci<code>~/.node_repl_history</code>, which is overridden by this variable. Setting the value 21931cb0ef41Sopenharmony_cito an empty string (<code>''</code> or <code>' '</code>) disables persistent REPL history.</p> 21941cb0ef41Sopenharmony_ci<h4><code>NODE_REPL_EXTERNAL_MODULE=file</code><span><a class="mark" href="#node_repl_external_modulefile" id="node_repl_external_modulefile">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_repl_external_module_file"></a></h4> 21951cb0ef41Sopenharmony_ci<div class="api_metadata"> 21961cb0ef41Sopenharmony_ci<span>Added in: v13.0.0, v12.16.0</span> 21971cb0ef41Sopenharmony_ci</div> 21981cb0ef41Sopenharmony_ci<p>Path to a Node.js module which will be loaded in place of the built-in REPL. 21991cb0ef41Sopenharmony_ciOverriding this value to an empty string (<code>''</code>) will use the built-in REPL.</p> 22001cb0ef41Sopenharmony_ci<h4><code>NODE_SKIP_PLATFORM_CHECK=value</code><span><a class="mark" href="#node_skip_platform_checkvalue" id="node_skip_platform_checkvalue">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_skip_platform_check_value"></a></h4> 22011cb0ef41Sopenharmony_ci<div class="api_metadata"> 22021cb0ef41Sopenharmony_ci<span>Added in: v14.5.0</span> 22031cb0ef41Sopenharmony_ci</div> 22041cb0ef41Sopenharmony_ci<p>If <code>value</code> equals <code>'1'</code>, the check for a supported platform is skipped during 22051cb0ef41Sopenharmony_ciNode.js startup. Node.js might not execute correctly. Any issues encountered 22061cb0ef41Sopenharmony_cion unsupported platforms will not be fixed.</p> 22071cb0ef41Sopenharmony_ci<h4><code>NODE_TEST_CONTEXT=value</code><span><a class="mark" href="#node_test_contextvalue" id="node_test_contextvalue">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_test_context_value"></a></h4> 22081cb0ef41Sopenharmony_ci<p>If <code>value</code> equals <code>'child'</code>, test reporter options will be overridden and test 22091cb0ef41Sopenharmony_cioutput will be sent to stdout in the TAP format. If any other value is provided, 22101cb0ef41Sopenharmony_ciNode.js makes no guarantees about the reporter format used or its stability.</p> 22111cb0ef41Sopenharmony_ci<h4><code>NODE_TLS_REJECT_UNAUTHORIZED=value</code><span><a class="mark" href="#node_tls_reject_unauthorizedvalue" id="node_tls_reject_unauthorizedvalue">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_tls_reject_unauthorized_value"></a></h4> 22121cb0ef41Sopenharmony_ci<p>If <code>value</code> equals <code>'0'</code>, certificate validation is disabled for TLS connections. 22131cb0ef41Sopenharmony_ciThis makes TLS, and HTTPS by extension, insecure. The use of this environment 22141cb0ef41Sopenharmony_civariable is strongly discouraged.</p> 22151cb0ef41Sopenharmony_ci<h4><code>NODE_V8_COVERAGE=dir</code><span><a class="mark" href="#node_v8_coveragedir" id="node_v8_coveragedir">#</a></span><a aria-hidden="true" class="legacy" id="cli_node_v8_coverage_dir"></a></h4> 22161cb0ef41Sopenharmony_ci<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 22171cb0ef41Sopenharmony_ci<a href="https://sourcemaps.info/spec.html">Source Map</a> data to the directory provided as an argument (coverage 22181cb0ef41Sopenharmony_ciinformation is written as JSON to files with a <code>coverage</code> prefix).</p> 22191cb0ef41Sopenharmony_ci<p><code>NODE_V8_COVERAGE</code> will automatically propagate to subprocesses, making it 22201cb0ef41Sopenharmony_cieasier to instrument applications that call the <code>child_process.spawn()</code> family 22211cb0ef41Sopenharmony_ciof functions. <code>NODE_V8_COVERAGE</code> can be set to an empty string, to prevent 22221cb0ef41Sopenharmony_cipropagation.</p> 22231cb0ef41Sopenharmony_ci<h5>Coverage output<span><a class="mark" href="#coverage-output" id="coverage-output">#</a></span><a aria-hidden="true" class="legacy" id="cli_coverage_output"></a></h5> 22241cb0ef41Sopenharmony_ci<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 22251cb0ef41Sopenharmony_cikey <code>result</code>:</p> 22261cb0ef41Sopenharmony_ci<pre><code class="language-json"><span class="hljs-punctuation">{</span> 22271cb0ef41Sopenharmony_ci <span class="hljs-attr">"result"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span> 22281cb0ef41Sopenharmony_ci <span class="hljs-punctuation">{</span> 22291cb0ef41Sopenharmony_ci <span class="hljs-attr">"scriptId"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"67"</span><span class="hljs-punctuation">,</span> 22301cb0ef41Sopenharmony_ci <span class="hljs-attr">"url"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"internal/tty.js"</span><span class="hljs-punctuation">,</span> 22311cb0ef41Sopenharmony_ci <span class="hljs-attr">"functions"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span> 22321cb0ef41Sopenharmony_ci <span class="hljs-punctuation">}</span> 22331cb0ef41Sopenharmony_ci <span class="hljs-punctuation">]</span> 22341cb0ef41Sopenharmony_ci<span class="hljs-punctuation">}</span></code> <button class="copy-button">copy</button></pre> 22351cb0ef41Sopenharmony_ci<h5>Source map cache<span><a class="mark" href="#source-map-cache" id="source-map-cache">#</a></span><a aria-hidden="true" class="legacy" id="cli_source_map_cache"></a></h5> 22361cb0ef41Sopenharmony_ci<p></p><div class="api_stability api_stability_1"><a href="documentation.html#stability-index">Stability: 1</a> - Experimental</div><p></p> 22371cb0ef41Sopenharmony_ci<p>If found, source map data is appended to the top-level key <code>source-map-cache</code> 22381cb0ef41Sopenharmony_cion the JSON coverage object.</p> 22391cb0ef41Sopenharmony_ci<p><code>source-map-cache</code> is an object with keys representing the files source maps 22401cb0ef41Sopenharmony_ciwere extracted from, and values which include the raw source-map URL 22411cb0ef41Sopenharmony_ci(in the key <code>url</code>), the parsed Source Map v3 information (in the key <code>data</code>), 22421cb0ef41Sopenharmony_ciand the line lengths of the source file (in the key <code>lineLengths</code>).</p> 22431cb0ef41Sopenharmony_ci<pre><code class="language-json"><span class="hljs-punctuation">{</span> 22441cb0ef41Sopenharmony_ci <span class="hljs-attr">"result"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span> 22451cb0ef41Sopenharmony_ci <span class="hljs-punctuation">{</span> 22461cb0ef41Sopenharmony_ci <span class="hljs-attr">"scriptId"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"68"</span><span class="hljs-punctuation">,</span> 22471cb0ef41Sopenharmony_ci <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> 22481cb0ef41Sopenharmony_ci <span class="hljs-attr">"functions"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-punctuation">]</span> 22491cb0ef41Sopenharmony_ci <span class="hljs-punctuation">}</span> 22501cb0ef41Sopenharmony_ci <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span> 22511cb0ef41Sopenharmony_ci <span class="hljs-attr">"source-map-cache"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> 22521cb0ef41Sopenharmony_ci <span class="hljs-attr">"file:///absolute/path/to/source.js"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> 22531cb0ef41Sopenharmony_ci <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> 22541cb0ef41Sopenharmony_ci <span class="hljs-attr">"data"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> 22551cb0ef41Sopenharmony_ci <span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">3</span><span class="hljs-punctuation">,</span> 22561cb0ef41Sopenharmony_ci <span class="hljs-attr">"sources"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span> 22571cb0ef41Sopenharmony_ci <span class="hljs-string">"file:///absolute/path/to/original.js"</span> 22581cb0ef41Sopenharmony_ci <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span> 22591cb0ef41Sopenharmony_ci <span class="hljs-attr">"names"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span> 22601cb0ef41Sopenharmony_ci <span class="hljs-string">"Foo"</span><span class="hljs-punctuation">,</span> 22611cb0ef41Sopenharmony_ci <span class="hljs-string">"console"</span><span class="hljs-punctuation">,</span> 22621cb0ef41Sopenharmony_ci <span class="hljs-string">"info"</span> 22631cb0ef41Sopenharmony_ci <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span> 22641cb0ef41Sopenharmony_ci <span class="hljs-attr">"mappings"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"MAAMA,IACJC,YAAaC"</span><span class="hljs-punctuation">,</span> 22651cb0ef41Sopenharmony_ci <span class="hljs-attr">"sourceRoot"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"./"</span> 22661cb0ef41Sopenharmony_ci <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span> 22671cb0ef41Sopenharmony_ci <span class="hljs-attr">"lineLengths"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span> 22681cb0ef41Sopenharmony_ci <span class="hljs-number">13</span><span class="hljs-punctuation">,</span> 22691cb0ef41Sopenharmony_ci <span class="hljs-number">62</span><span class="hljs-punctuation">,</span> 22701cb0ef41Sopenharmony_ci <span class="hljs-number">38</span><span class="hljs-punctuation">,</span> 22711cb0ef41Sopenharmony_ci <span class="hljs-number">27</span> 22721cb0ef41Sopenharmony_ci <span class="hljs-punctuation">]</span> 22731cb0ef41Sopenharmony_ci <span class="hljs-punctuation">}</span> 22741cb0ef41Sopenharmony_ci <span class="hljs-punctuation">}</span> 22751cb0ef41Sopenharmony_ci<span class="hljs-punctuation">}</span></code> <button class="copy-button">copy</button></pre> 22761cb0ef41Sopenharmony_ci<h4><code>NO_COLOR=<any></code><span><a class="mark" href="#no_colorany" id="no_colorany">#</a></span><a aria-hidden="true" class="legacy" id="cli_no_color_any"></a></h4> 22771cb0ef41Sopenharmony_ci<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 22781cb0ef41Sopenharmony_cienvironment variable is arbitrary.</p> 22791cb0ef41Sopenharmony_ci<h4><code>OPENSSL_CONF=file</code><span><a class="mark" href="#openssl_conffile" id="openssl_conffile">#</a></span><a aria-hidden="true" class="legacy" id="cli_openssl_conf_file"></a></h4> 22801cb0ef41Sopenharmony_ci<div class="api_metadata"> 22811cb0ef41Sopenharmony_ci<span>Added in: v6.11.0</span> 22821cb0ef41Sopenharmony_ci</div> 22831cb0ef41Sopenharmony_ci<p>Load an OpenSSL configuration file on startup. Among other uses, this can be 22841cb0ef41Sopenharmony_ciused to enable FIPS-compliant crypto if Node.js is built with 22851cb0ef41Sopenharmony_ci<code>./configure --openssl-fips</code>.</p> 22861cb0ef41Sopenharmony_ci<p>If the <a href="#--openssl-configfile"><code>--openssl-config</code></a> command-line option is used, the environment 22871cb0ef41Sopenharmony_civariable is ignored.</p> 22881cb0ef41Sopenharmony_ci<h4><code>SSL_CERT_DIR=dir</code><span><a class="mark" href="#ssl_cert_dirdir" id="ssl_cert_dirdir">#</a></span><a aria-hidden="true" class="legacy" id="cli_ssl_cert_dir_dir"></a></h4> 22891cb0ef41Sopenharmony_ci<div class="api_metadata"> 22901cb0ef41Sopenharmony_ci<span>Added in: v7.7.0</span> 22911cb0ef41Sopenharmony_ci</div> 22921cb0ef41Sopenharmony_ci<p>If <code>--use-openssl-ca</code> is enabled, this overrides and sets OpenSSL's directory 22931cb0ef41Sopenharmony_cicontaining trusted certificates.</p> 22941cb0ef41Sopenharmony_ci<p>Be aware that unless the child environment is explicitly set, this environment 22951cb0ef41Sopenharmony_civariable will be inherited by any child processes, and if they use OpenSSL, it 22961cb0ef41Sopenharmony_cimay cause them to trust the same CAs as node.</p> 22971cb0ef41Sopenharmony_ci<h4><code>SSL_CERT_FILE=file</code><span><a class="mark" href="#ssl_cert_filefile" id="ssl_cert_filefile">#</a></span><a aria-hidden="true" class="legacy" id="cli_ssl_cert_file_file"></a></h4> 22981cb0ef41Sopenharmony_ci<div class="api_metadata"> 22991cb0ef41Sopenharmony_ci<span>Added in: v7.7.0</span> 23001cb0ef41Sopenharmony_ci</div> 23011cb0ef41Sopenharmony_ci<p>If <code>--use-openssl-ca</code> is enabled, this overrides and sets OpenSSL's file 23021cb0ef41Sopenharmony_cicontaining trusted certificates.</p> 23031cb0ef41Sopenharmony_ci<p>Be aware that unless the child environment is explicitly set, this environment 23041cb0ef41Sopenharmony_civariable will be inherited by any child processes, and if they use OpenSSL, it 23051cb0ef41Sopenharmony_cimay cause them to trust the same CAs as node.</p> 23061cb0ef41Sopenharmony_ci<h4><code>TZ</code><span><a class="mark" href="#tz" id="tz">#</a></span><a aria-hidden="true" class="legacy" id="cli_tz"></a></h4> 23071cb0ef41Sopenharmony_ci<div class="api_metadata"> 23081cb0ef41Sopenharmony_ci<details class="changelog"><summary>History</summary> 23091cb0ef41Sopenharmony_ci<table> 23101cb0ef41Sopenharmony_ci<tbody><tr><th>Version</th><th>Changes</th></tr> 23111cb0ef41Sopenharmony_ci<tr><td>v16.2.0</td> 23121cb0ef41Sopenharmony_ci<td><p>Changing the TZ variable using process.env.TZ = changes the timezone on Windows as well.</p></td></tr> 23131cb0ef41Sopenharmony_ci<tr><td>v13.0.0</td> 23141cb0ef41Sopenharmony_ci<td><p>Changing the TZ variable using process.env.TZ = changes the timezone on POSIX systems.</p></td></tr> 23151cb0ef41Sopenharmony_ci<tr><td>v0.0.1</td> 23161cb0ef41Sopenharmony_ci<td><p><span>Added in: v0.0.1</span></p></td></tr> 23171cb0ef41Sopenharmony_ci</tbody></table> 23181cb0ef41Sopenharmony_ci</details> 23191cb0ef41Sopenharmony_ci</div> 23201cb0ef41Sopenharmony_ci<p>The <code>TZ</code> environment variable is used to specify the timezone configuration.</p> 23211cb0ef41Sopenharmony_ci<p>While Node.js does not support all of the various <a href="https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html">ways that <code>TZ</code> is handled in 23221cb0ef41Sopenharmony_ciother environments</a>, it does support basic <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">timezone IDs</a> (such as 23231cb0ef41Sopenharmony_ci<code>'Etc/UTC'</code>, <code>'Europe/Paris'</code>, or <code>'America/New_York'</code>). 23241cb0ef41Sopenharmony_ciIt may support a few other abbreviations or aliases, but these are strongly 23251cb0ef41Sopenharmony_cidiscouraged and not guaranteed.</p> 23261cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">TZ=Europe/Dublin node -pe <span class="hljs-string">"new Date().toString()"</span></span> 23271cb0ef41Sopenharmony_ciWed May 12 2021 20:30:48 GMT+0100 (Irish Standard Time)</code> <button class="copy-button">copy</button></pre> 23281cb0ef41Sopenharmony_ci<h4><code>UV_THREADPOOL_SIZE=size</code><span><a class="mark" href="#uv_threadpool_sizesize" id="uv_threadpool_sizesize">#</a></span><a aria-hidden="true" class="legacy" id="cli_uv_threadpool_size_size"></a></h4> 23291cb0ef41Sopenharmony_ci<p>Set the number of threads used in libuv's threadpool to <code>size</code> threads.</p> 23301cb0ef41Sopenharmony_ci<p>Asynchronous system APIs are used by Node.js whenever possible, but where they 23311cb0ef41Sopenharmony_cido not exist, libuv's threadpool is used to create asynchronous node APIs based 23321cb0ef41Sopenharmony_cion synchronous system APIs. Node.js APIs that use the threadpool are:</p> 23331cb0ef41Sopenharmony_ci<ul> 23341cb0ef41Sopenharmony_ci<li>all <code>fs</code> APIs, other than the file watcher APIs and those that are explicitly 23351cb0ef41Sopenharmony_cisynchronous</li> 23361cb0ef41Sopenharmony_ci<li>asynchronous crypto APIs such as <code>crypto.pbkdf2()</code>, <code>crypto.scrypt()</code>, 23371cb0ef41Sopenharmony_ci<code>crypto.randomBytes()</code>, <code>crypto.randomFill()</code>, <code>crypto.generateKeyPair()</code></li> 23381cb0ef41Sopenharmony_ci<li><code>dns.lookup()</code></li> 23391cb0ef41Sopenharmony_ci<li>all <code>zlib</code> APIs, other than those that are explicitly synchronous</li> 23401cb0ef41Sopenharmony_ci</ul> 23411cb0ef41Sopenharmony_ci<p>Because libuv's threadpool has a fixed size, it means that if for whatever 23421cb0ef41Sopenharmony_cireason any of these APIs takes a long time, other (seemingly unrelated) APIs 23431cb0ef41Sopenharmony_cithat run in libuv's threadpool will experience degraded performance. In order to 23441cb0ef41Sopenharmony_cimitigate this issue, one potential solution is to increase the size of libuv's 23451cb0ef41Sopenharmony_cithreadpool by setting the <code>'UV_THREADPOOL_SIZE'</code> environment variable to a value 23461cb0ef41Sopenharmony_cigreater than <code>4</code> (its current default value). For more information, see the 23471cb0ef41Sopenharmony_ci<a href="https://docs.libuv.org/en/latest/threadpool.html">libuv threadpool documentation</a>.</p> 23481cb0ef41Sopenharmony_ci</section><section><h3>Useful V8 options<span><a class="mark" href="#useful-v8-options" id="useful-v8-options">#</a></span><a aria-hidden="true" class="legacy" id="cli_useful_v8_options"></a></h3> 23491cb0ef41Sopenharmony_ci<p>V8 has its own set of CLI options. Any V8 CLI option that is provided to <code>node</code> 23501cb0ef41Sopenharmony_ciwill be passed on to V8 to handle. V8's options have <em>no stability guarantee</em>. 23511cb0ef41Sopenharmony_ciThe V8 team themselves don't consider them to be part of their formal API, 23521cb0ef41Sopenharmony_ciand reserve the right to change them at any time. Likewise, they are not 23531cb0ef41Sopenharmony_cicovered by the Node.js stability guarantees. Many of the V8 23541cb0ef41Sopenharmony_cioptions are of interest only to V8 developers. Despite this, there is a small 23551cb0ef41Sopenharmony_ciset of V8 options that are widely applicable to Node.js, and they are 23561cb0ef41Sopenharmony_cidocumented here:</p> 23571cb0ef41Sopenharmony_ci<h4><code>--max-old-space-size=SIZE</code> (in megabytes)<span><a class="mark" href="#--max-old-space-sizesize-in-megabytes" id="--max-old-space-sizesize-in-megabytes">#</a></span><a aria-hidden="true" class="legacy" id="cli_max_old_space_size_size_in_megabytes"></a></h4> 23581cb0ef41Sopenharmony_ci<p>Sets the max memory size of V8's old memory section. As memory 23591cb0ef41Sopenharmony_ciconsumption approaches the limit, V8 will spend more time on 23601cb0ef41Sopenharmony_cigarbage collection in an effort to free unused memory.</p> 23611cb0ef41Sopenharmony_ci<p>On a machine with 2 GiB of memory, consider setting this to 23621cb0ef41Sopenharmony_ci1536 (1.5 GiB) to leave some memory for other uses and avoid swapping.</p> 23631cb0ef41Sopenharmony_ci<pre><code class="language-console"><span class="hljs-meta prompt_">$ </span><span class="language-bash">node --max-old-space-size=1536 index.js</span></code> <button class="copy-button">copy</button></pre> 23641cb0ef41Sopenharmony_ci<h4><code>--max-semi-space-size=SIZE</code> (in megabytes)<span><a class="mark" href="#--max-semi-space-sizesize-in-megabytes" id="--max-semi-space-sizesize-in-megabytes">#</a></span><a aria-hidden="true" class="legacy" id="cli_max_semi_space_size_size_in_megabytes"></a></h4> 23651cb0ef41Sopenharmony_ci<p>Sets the maximum <a href="https://www.memorymanagement.org/glossary/s.html#semi.space">semi-space</a> size for V8's <a href="https://v8.dev/blog/orinoco-parallel-scavenger">scavenge garbage collector</a> in 23661cb0ef41Sopenharmony_ciMiB (megabytes). 23671cb0ef41Sopenharmony_ciIncreasing the max size of a semi-space may improve throughput for Node.js at 23681cb0ef41Sopenharmony_cithe cost of more memory consumption.</p> 23691cb0ef41Sopenharmony_ci<p>Since the young generation size of the V8 heap is three times (see 23701cb0ef41Sopenharmony_ci<a href="https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.3.129/src/heap/heap.cc#328"><code>YoungGenerationSizeFromSemiSpaceSize</code></a> in V8) the size of the semi-space, 23711cb0ef41Sopenharmony_cian increase of 1 MiB to semi-space applies to each of the three individual 23721cb0ef41Sopenharmony_cisemi-spaces and causes the heap size to increase by 3 MiB. The throughput 23731cb0ef41Sopenharmony_ciimprovement depends on your workload (see <a href="https://github.com/nodejs/node/issues/42511">#42511</a>).</p> 23741cb0ef41Sopenharmony_ci<p>The default value is 16 MiB for 64-bit systems and 8 MiB for 32-bit systems. To 23751cb0ef41Sopenharmony_ciget the best configuration for your application, you should try different 23761cb0ef41Sopenharmony_cimax-semi-space-size values when running benchmarks for your application.</p> 23771cb0ef41Sopenharmony_ci<p>For example, benchmark on a 64-bit systems:</p> 23781cb0ef41Sopenharmony_ci<pre><code class="language-bash"><span class="hljs-keyword">for</span> MiB <span class="hljs-keyword">in</span> 16 32 64 128; <span class="hljs-keyword">do</span> 23791cb0ef41Sopenharmony_ci node --max-semi-space-size=<span class="hljs-variable">$MiB</span> index.js 23801cb0ef41Sopenharmony_ci<span class="hljs-keyword">done</span></code> <button class="copy-button">copy</button></pre></section> 23811cb0ef41Sopenharmony_ci <!-- API END --> 23821cb0ef41Sopenharmony_ci </div> 23831cb0ef41Sopenharmony_ci </div> 23841cb0ef41Sopenharmony_ci </div> 23851cb0ef41Sopenharmony_ci</body> 23861cb0ef41Sopenharmony_ci</html> 2387