NODE-22(1)

๐Ÿ“ฆ version 22.23.1, in fedora 44

โœจ NAME โœจ

okay so the name is node ๐ŸŒธ it's a server-side JavaScript runtime, which means it runs JS outside the browser ๐Ÿ’ปโœจ

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

node [options] [v8-options] [-e string | script.js | -] [--]
     [arguments ...]
node inspect [-e string | script.js | - | <host>:<port>] ...
node [--v8-options]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

Okay so Node.js is a set of libraries for JavaScript that lets it be used outside of the browser ๐ŸŒˆ It's mostly obsessed with making simple, easy-to-build network clients and servers, and it is literally iconic at it ๐Ÿซถ

Just run node with no arguments and boom, you're in a REPL ๐Ÿ’œ

๐Ÿฆ‹ OPTIONS ๐Ÿฆ‹

  • - โ€” this is an alias for stdin, kinda like how - works in other command-line tools ๐Ÿงš The script gets read from stdin, and any leftover arguments get passed along to the script.
  • -- โ€” this marks the end of the command-line options ๐Ÿ’– Everything after it goes to the script.

If you haven't given a script filename or an eval/print script before this, then the next argument becomes the script filename โœจ

  • --abort-on-uncaught-exception โ€” instead of exiting, Node aborts, and that generates a core file you can analyze later ๐Ÿ’€
  • --allow-fs-read โ€” allows file system read access when you're using the permission model ๐Ÿ“‚
  • --allow-fs-write โ€” allows file system write access when you're using the permission model โœ๏ธ
  • --allow-addons โ€” allows native addons when you're using the permission model ๐Ÿ”Œ
  • --allow-child-process โ€” allows spawning processes when you're using the permission model ๐ŸŒฑ
  • --allow-wasi โ€” allows WASI execution when you're using the permission model ๐Ÿฆ‹
  • --allow-worker โ€” allows creating worker threads when you're using the permission model ๐Ÿงต
  • --completion-bash โ€” prints a source-able bash completion script for Node.js ๐Ÿšโœจ
  • -C, --conditions string โ€” uses custom conditional exports conditions ๐ŸŽฏ The string is what you pass in ๐Ÿซถ
  • --cpu-prof โ€” starts the V8 CPU profiler on startup and writes the CPU profile to disk before exit ๐Ÿ”ฅ If you don't specify --cpu-prof-dir, the profile lands in your current working directory with a generated file name ๐Ÿ“
  • --cpu-prof-dir โ€” the directory where CPU profiles from --cpu-prof get placed ๐Ÿ—‚๏ธ Its default is controlled by --diagnostic-dir.
  • --cpu-prof-interval โ€” the sampling interval, in microseconds, for CPU profiles made with --cpu-prof โฑ๏ธ The default is 1000.
  • --cpu-prof-name โ€” the file name of the V8 CPU profile generated with --cpu-prof ๐Ÿท๏ธ
  • --diagnostic-dir โ€” sets the directory for all diagnostic output files ๐Ÿฉบ The default is the current working directory, which is also where all diagnostic output gets written by default. It also decides the default output directory for --cpu-prof-dir, --heap-prof-dir, and --redirect-warnings ๐Ÿ’…
  • --disable-proto=mode โ€” disables the Object.prototype.__proto__ property ๐Ÿ™ˆ If mode is delete, the property gets removed entirely. If mode is throw, touching the property throws an exception with the code ERR_PROTO_ACCESS ๐Ÿ’ฅ
  • --disable-wasm-trap-handler=mode โ€” disables trap-handler-based WebAssembly bound checks and falls back to inline bound checks instead ๐Ÿง  This lets WebAssembly run with limited virtual memory ๐ŸŒธ
  • --disallow-code-generation-from-strings โ€” makes built-in features like eval and new Function, which generate code from strings, throw an exception instead ๐Ÿšซ This does not touch the Node.js vm module ๐Ÿซ 
  • --enable-fips โ€” enables FIPS-compliant crypto at startup ๐Ÿ” This requires Node.js to be built with ./configure --openssl-fips.
  • --enable-source-maps โ€” enables Source Map V3 support for stack traces ๐Ÿ—บ๏ธ
  • --entry-url โ€” interprets the entry point as a URL ๐Ÿ”—
  • --experimental-addon-modules โ€” enables experimental addon module support ๐Ÿงช
  • --experimental-default-type=type โ€” interprets input from --eval or STDIN as either ES modules or CommonJS modules, but only when --input-type isn't specified ๐ŸŽ€
  • --experimental-config-file โ€” specifies the configuration file to load ๐Ÿ“œ
  • --experimental-default-config-file โ€” enables automatic loading of node.config.json ๐Ÿช„
  • --experimental-import-meta-resolve โ€” enables experimental ES modules support for import.meta.resolve() โœจ
  • --experimental-loader=module โ€” specifies the module to use as a custom module loader ๐Ÿงณ
  • --permission โ€” enables the permission model ๐Ÿ›ก๏ธ
  • --experimental-shadow-realm โ€” use this to turn on ShadowRealm support ๐Ÿ‘ป
  • --experimental-test-coverage โ€” enables code coverage in the test runner ๐Ÿ“Š
  • --experimental-test-isolation=mode โ€” configures the type of test isolation the test runner uses ๐Ÿงผ
  • --experimental-test-module-mocks โ€” enables module mocking in the test runner ๐ŸŽญ
  • --experimental-transform-types โ€” enables transforming TypeScript-only syntax into JavaScript ๐Ÿ”„
  • --experimental-eventsource โ€” enables experimental support for the EventSource Web API ๐Ÿ“ก
  • --no-experimental-fetch โ€” disables experimental support for the Fetch API ๐Ÿšซ
  • --no-experimental-websocket โ€” disables experimental support for the WebSocket API ๐Ÿ”Œ๐Ÿšซ
  • --experimental-webstorage โ€” enables experimental support for the Web Storage API ๐Ÿ’พ
  • --no-experimental-global-customevent โ€” stops CustomEvent from being exposed on the global scope ๐Ÿ™…
  • --no-experimental-global-webcrypto โ€” stops the Web Crypto API from being exposed on the global scope ๐Ÿ™…โ€โ™€๏ธ
  • --no-experimental-repl-await โ€” disables top-level await keyword support in the REPL ๐ŸŒ™
  • --no-experimental-sqlite โ€” disables the experimental node:sqlite module ๐Ÿ—ƒ๏ธ๐Ÿšซ
  • --no-experimental-strip-types โ€” disables experimental type-stripping for TypeScript files ๐Ÿงท
  • --experimental-vm-modules โ€” enables experimental ES module support in the VM module ๐Ÿงช๐Ÿงฉ
  • --experimental-wasi-unstable-preview1 โ€” enables experimental WebAssembly System Interface support ๐Ÿฆ‹ You don't need this flag anymore, since WASI is enabled by default now ๐Ÿ’…
  • --experimental-inspector-network-resource โ€” enables experimental support for inspector network resources ๐Ÿ•ธ๏ธ
  • --force-context-aware โ€” disables loading native addons that aren't context-aware ๐Ÿšท
  • --force-fips โ€” forces FIPS-compliant crypto on startup ๐Ÿ”’ It cannot be turned off from script code, so it's a hard lock ๐Ÿ˜ค It has the same requirements as --enable-fips.
  • --frozen-intrinsics โ€” enables experimental frozen intrinsics support ๐ŸงŠ
  • --heapsnapshot-near-heap-limit=max_count โ€” generates a heap snapshot when V8 heap usage is getting close to the heap limit ๐Ÿ“ธ No more than the number of snapshots you specify (max_count) will be generated.
  • --heapsnapshot-signal=signal โ€” generates a heap snapshot when the specified signal arrives ๐Ÿšจ
  • --heap-prof โ€” starts the V8 heap profiler on startup and writes the heap profile to disk before exit ๐Ÿง If you don't specify --heap-prof-dir, it goes to the current working directory with a generated file name ๐Ÿ“
  • --heap-prof-dir โ€” the directory where heap profiles from --heap-prof get placed ๐Ÿ—‚๏ธ Its default is controlled by --diagnostic-dir.
  • --heap-prof-interval โ€” the average sampling interval, in bytes, for heap profiles made with --heap-prof ๐Ÿ“ The default is 512 * 1024.
  • --heap-prof-name โ€” the file name of the V8 heap profile generated with --heap-prof ๐Ÿท๏ธ
  • --icu-data-dir=file โ€” specifies the ICU data load path ๐ŸŒ This overrides NODE_ICU_DATA.
  • --input-type=type โ€” sets the module resolution type for input coming in via --eval, --print, or STDIN ๐ŸŽฏ
  • --inspect-brk=[host:]port โ€” activates the inspector on host:port and breaks at the start of the user script ๐Ÿ›‘
  • --inspect-port=[host:]port โ€” sets the host:port used when the inspector is activated ๐Ÿ”Œ
  • --inspect-publish-uid=stderr,http โ€” specifies how the inspector WebSocket URL gets exposed ๐Ÿ“ฃ The valid values are stderr and http, and the default is stderr,http ๐Ÿ’œ
  • --inspect-wait=[host:]port โ€” activates the inspector on host:port and waits for a debugger to attach ๐Ÿง˜
  • --inspect=[host:]port โ€” activates the inspector on host:port ๐Ÿ” The default is 127.0.0.1:9229.

V8 Inspector integration lets you attach Chrome DevTools and IDEs to Node.js instances for debugging and profiling ๐Ÿ› ๏ธ It uses the Chrome DevTools Protocol ๐ŸŒธ

  • --insecure-http-parser โ€” uses an insecure HTTP parser that accepts invalid HTTP headers ๐Ÿ™ˆ This might let you interoperate with non-conformant HTTP implementations, but it can also allow request smuggling and other HTTP attacks that depend on invalid headers being accepted.
๐Ÿšจ Avoid using this option. It opens the door to request smuggling and other attacks, so please don't ๐Ÿ˜ญ
  • --jitless โ€” disables runtime allocation of executable memory ๐Ÿข Some platforms may need this for security reasons. It can also shrink the attack surface on other platforms, but the performance hit may be severe ๐Ÿ’€

This flag is inherited from V8 and is subject to change upstream. It might disappear in a non-semver-major release, so don't get too attached ๐Ÿฅบ

  • --localstorage-file=file โ€” the file used to store localStorage data ๐Ÿ’พ
  • --max-http-header-size=size โ€” sets the maximum size of HTTP headers in bytes ๐Ÿ“ It defaults to 16 KiB.
  • --max-old-space-size-percentage=percentage โ€” sets the maximum memory size of V8's old memory section as a percentage of available system memory ๐Ÿ“Š If you specify both this and --max-old-space-size, this one wins ๐Ÿ‘‘ The percentage must be a number greater than 0 and up to 100, representing how much of the available system memory goes to the V8 heap.

Note: this flag uses --max-old-space-size, which may be unreliable on 32-bit platforms because of integer overflow issues ๐Ÿ™ˆ

  • --napi-modules โ€” this is a no-op ๐Ÿ˜ด It's only kept for compatibility.
  • --no-deprecation โ€” silences deprecation warnings ๐Ÿคซ
  • --no-extra-info-on-fatal-exception โ€” hides the extra information on a fatal exception that causes an exit ๐Ÿซฅ
  • --no-force-async-hooks-checks โ€” disables runtime checks for async_hooks ๐Ÿงต They'll still be turned on dynamically whenever async_hooks is enabled.
  • --no-addons โ€” disables the node-addons exports condition and also disables loading native addons ๐Ÿšซ๐Ÿ”Œ With --no-addons specified, calling process.dlopen or requiring a native C++ addon will fail and throw an exception ๐Ÿ’ฅ

  • --no-global-search-paths โ€” ๐Ÿ™…โ€โ™€๏ธ Modules won't get searched in the global paths. Nope, not happening.
  • --no-warnings โ€” ๐Ÿ”‡ Silences every process warning, deprecations included. Shh ๐Ÿคซ
  • --node-memory-debug โ€” ๐Ÿง  Turns on extra debug checks for memory leaks inside Node.js internals. Honestly this is mostly for developers debugging Node.js itself, so you probably won't need it, bestie ๐Ÿ’€
  • --openssl-config=file โ€” ๐Ÿ” Loads an OpenSSL configuration file on startup. One of the things it can do is turn on FIPS-compliant crypto, but only if Node.js was built with ./configure --openssl-fips. Very specific, very cool โœจ
  • --pending-deprecation โ€” โณ Emits pending deprecation warnings, so you get a heads up before stuff goes away ๐Ÿ‘€
  • --preserve-symlinks โ€” ๐Ÿ”— Tells the module loader to keep symbolic links intact when it resolves and caches modules that aren't the main module.
  • --preserve-symlinks-main โ€” ๐Ÿ”— Same vibe, but for the main module. The module loader keeps the symbolic links when resolving and caching it.
  • --prof โ€” ๐Ÿ“Š Generates V8 profiler output. Data time ๐Ÿ“
  • --prof-process โ€” ๐Ÿง Processes V8 profiler output that was made with the V8 option --prof. Get the tea โ˜•
  • --redirect-warnings=file โ€” ๐Ÿ“ Sends process warnings to the file you give it, instead of printing them to stderr. Keeps your terminal clean and cute ๐ŸŽ€
  • --report-compact โ€” ๐Ÿ“ฆ Writes diagnostic reports in a compact format, as single-line JSON. Tiny, tidy, no drama ๐Ÿ’œ
  • --report-dir, --report-directory โ€” ๐Ÿ“‚ Sets the location where the diagnostic report gets generated. The file name can be an absolute path. If it isn't one, the default directory it lands in is controlled by --diagnostic-dir, which is another command-line option.
  • --report-filename โ€” ๐Ÿท๏ธ Names the file the diagnostic report will be written to.
  • --report-on-fatalerror โ€” ๐Ÿ’ฅ Lets the diagnostic report trigger on fatal errors, which are internal errors inside the Node.js runtime (like running out of memory) that end the application. It's amazing for checking out the heap, stack, event loop state, resource consumption and more, so you can figure out what went wrong ๐Ÿ”
  • --report-on-signal โ€” ๐Ÿ“ก Lets a diagnostic report get generated when the running Node.js process receives a signal. You can pick the signal, or it uses the predefined one. The default signal is SIGUSR2.
  • --report-signal โ€” ๐ŸŽš๏ธ Sets or resets the signal used for diagnostic report generation. Not supported on Windows ๐ŸชŸ The default signal is SIGUSR2.
  • --report-uncaught-exception โ€” ๐Ÿ™ˆ Lets a diagnostic report get generated for uncaught exceptions. It's super helpful when you want to look at the JavaScript stack next to the native stack and other runtime environment data.
  • --secure-heap=n โ€” ๐Ÿ”’ Sets the size of the OpenSSL secure heap. Any value less than 2 turns the secure heap off. The default is 0, and the value has to be a power of two ๐Ÿงฎ
  • --secure-heap-min=n โ€” ๐Ÿ” Sets the minimum allocation from the OpenSSL secure heap. The default is 2, and the value has to be a power of two too.
  • --test โ€” ๐Ÿงช Starts the Node.js command line test runner. Let's gooo โœ…
  • --test-concurrency โ€” ๐Ÿƒโ€โ™€๏ธ The maximum number of test files the test runner CLI will run at the same time.
  • --test-coverage-branches=threshold โ€” ๐ŸŒฟ Requires a minimum threshold for branch coverage, from 0 to 100.
  • --test-coverage-exclude โ€” ๐Ÿšซ A glob pattern that leaves matching files out of the coverage report.
  • --test-coverage-functions=threshold โ€” ๐Ÿงฉ Requires a minimum threshold for function coverage, from 0 to 100.
  • --test-coverage-include โ€” โœ… A glob pattern that only puts matching files into the coverage report.
  • --test-coverage-lines=threshold โ€” ๐Ÿ“ Requires a minimum threshold for line coverage, from 0 to 100.
  • --test-force-exit โ€” ๐Ÿšช Tells the test runner to exit the process once all the known tests are done, even if the event loop would otherwise stay active. Bye bye ๐Ÿ‘‹
  • --test-name-pattern โ€” ๐Ÿ”Ž A regular expression that makes the test runner only run tests whose name matches the pattern.
  • --test-reporter โ€” ๐Ÿ“ฃ The test reporter to use when running tests.
  • --test-reporter-destination โ€” ๐Ÿ—‚๏ธ The destination for the matching test reporter.
  • --test-only โ€” โญ Makes the test runner only run the top-level tests that have the only option set. Main character energy ๐Ÿ‘‘
  • --test-shard โ€” ๐Ÿฐ The test suite shard to run, in the format <index>/<total>.
  • --test-skip-pattern โ€” ๐Ÿ™… A regular expression that makes the test runner skip tests whose name matches the pattern.
  • --test-timeout โ€” โฐ The number of milliseconds the test execution will fail after.
  • --test-update-snapshots โ€” ๐Ÿ“ธ Regenerates the snapshot file the test runner uses for snapshot testing. Fresh pics only ๐Ÿซถ
  • --throw-deprecation โ€” ๐Ÿ’ฃ Throws errors for deprecations instead of just warning about them. Spicy ๐ŸŒถ๏ธ
  • --title=title โ€” ๐Ÿท๏ธ Sets process.title on startup.
  • --tls-cipher-list=list โ€” ๐Ÿ”‘ Sets an alternative default TLS cipher list. This needs Node.js to be built with crypto support. (Default) โœจ
  • --tls-keylog=file โ€” ๐Ÿ—๏ธ Logs TLS key material to a file. The key material is in NSS SSLKEYLOGFILE format, so software like Wireshark can use it to decrypt the TLS traffic ๐Ÿฆˆ
  • --tls-max-v1.2 โ€” ๐Ÿ•ฐ๏ธ Sets the default maxVersion to 'TLSv1.2'. Use it to turn off support for TLSv1.3.
  • --tls-max-v1.3 โ€” ๐Ÿš€ Sets the default maxVersion to 'TLSv1.3'. Use it to turn on support for TLSv1.3.
  • --tls-min-v1.0 โ€” ๐Ÿฆ• Sets the default minVersion to 'TLSv1'. Use it for compatibility with old TLS clients or servers.
  • --tls-min-v1.1 โ€” ๐Ÿฆ– Sets the default minVersion to 'TLSv1.1'. Use it for compatibility with old TLS clients or servers.
  • --tls-min-v1.2 โ€” ๐Ÿ”’ Sets the default minVersion to 'TLSv1.2'. This is the default for 12.x and later, but the option is still supported so older Node.js versions stay happy.
  • --tls-min-v1.3 โ€” ๐Ÿ›ก๏ธ Sets the default minVersion to 'TLSv1.3'. Use it to turn off support for TLSv1.2 in favour of TLSv1.3, which is more secure ๐Ÿ’–
  • --trace-atomics-wait โ€” ๐Ÿซฅ Prints short summaries of calls to Atomics.wait(). This flag is deprecated, so maybe don't get too attached ๐Ÿ’”
  • --trace-deprecation โ€” ๐Ÿ” Prints stack traces for deprecations.
  • --trace-event-categories categories โ€” ๐Ÿท๏ธ A comma-separated list of categories to trace when trace event tracing is turned on using --trace-events-enabled.
  • --trace-event-file-pattern pattern โ€” ๐Ÿ—บ๏ธ A template string that specifies the filepath for the trace event data. It supports ${rotation} and ${pid}.
  • --trace-events-enabled โ€” ๐Ÿ“ผ Turns on the collection of trace event tracing information.
  • --trace-exit โ€” ๐Ÿšจ Prints a stack trace whenever an environment is exited proactively, which means invoking process.exit().
  • --trace-sigint โ€” โœ‹ Prints a stack trace on SIGINT.
  • --trace-sync-io โ€” ๐Ÿข Prints a stack trace whenever synchronous I/O gets detected after the first turn of the event loop. Slow and steady, but we see you ๐Ÿ‘€
  • --trace-tls โ€” ๐Ÿ” Prints TLS packet trace information to stderr.
  • --trace-uncaught โ€” ๐Ÿ•ต๏ธโ€โ™€๏ธ Prints stack traces for uncaught exceptions. Usually you get the stack trace from when the Error got created, but this makes Node.js print the stack trace from where the value got thrown too. The thrown value doesn't have to be an Error instance, either.

Heads up though: turning this on may hurt garbage collection behaviour.

  • --trace-warnings โ€” โš ๏ธ Prints stack traces for process warnings, deprecations included.
  • --track-heap-objects โ€” ๐Ÿงบ Tracks heap object allocations for heap snapshots.
  • --unhandled-rejections=mode โ€” ๐Ÿ™‹โ€โ™€๏ธ Defines how unhandled rejections get handled. It can be strict (raises an error), warn (enforces warnings), or none (silences warnings).
  • --use-bundled-ca, --use-openssl-ca โ€” ๐Ÿฆ Picks the CA store. You can use the bundled Mozilla CA store that ships with the current Node.js version, or OpenSSL's default CA store. The default store can be picked at build-time.

The bundled CA store is a snapshot of the Mozilla CA store, fixed at release time. It's identical on all supported platforms, so no surprises ๐Ÿ’…

Using the OpenSSL store lets external changes to the store show up. On most Linux and BSD distributions, the distribution maintainers and system administrators look after this store. The OpenSSL CA store location depends on how the OpenSSL library is configured, but you can change it at runtime with environment variables.

See SSL_CERT_DIR and SSL_CERT_FILE. ๐ŸŒธ

  • --use-env-proxy โ€” ๐ŸŒ Parses proxy settings from the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables, then applies them to the global HTTP/HTTPS clients.
  • --use-system-ca โ€” ๐Ÿ–ฅ๏ธ Uses the trusted CA certificates in the system store, along with the certificates in the bundled Mozilla CA store and the certificates from NODE_EXTRA_CA_CERTS. On Windows and macOS it uses system APIs to bring in extra trusted certificates. On other platforms it's similar to --use-openssl-ca, except it caches the certificates on first load, and the system certificates get added alongside the others instead of replacing them. This flag supersedes --use-openssl-ca ๐Ÿซง
  • --use-largepages=mode โ€” ๐Ÿ“„ Re-maps the Node.js static code onto large memory pages at startup. If the target system supports it, the static code moves onto 2 MiB pages instead of 4 KiB pages.

mode has to be one of these values: off (the default, which means don't map), on (map and ignore failure, reporting it to stderr), or silent (map and quietly ignore failure).

  • --v8-options โ€” ๐Ÿ“œ Prints the V8 command-line options.
  • --v8-pool-size=num โ€” ๐Ÿงต Sets V8's thread pool size, which gets used to allocate background jobs. If it's set to 0, V8 picks an appropriate thread pool size based on the number of online processors. If the value is larger than V8's maximum, the largest value gets chosen instead.
  • --watch โ€” ๐Ÿ‘€ Starts Node.js in watch mode. In watch mode, changes to the watched files make the Node.js process restart ๐Ÿ”„

By default, watch mode keeps an eye on the entry point and any required or imported module, lowkey the whole crew. If you want to pick exactly which paths get watched, reach for --watch-path ๐Ÿ‘€

๐Ÿฆ‹ --watch-path

Starts Node.js in watch mode and tells it which paths to watch ๐ŸŽ€. Once you're in watch mode, any change in those watched paths makes the Node.js process restart, so you get that fresh-start glow-up automatically โœจ

Heads up, bestie: using this turns off watching for required or imported modules, even if you pair it with --watch ๐Ÿ™ˆ

๐ŸŒท --watch-kill-signal

Lets you customize the signal that gets sent to the process whenever watch mode restarts it ๐Ÿ’…

๐Ÿซง --zero-fill-buffers

Automatically zero-fills every newly allocated Buffer and SlowBuffer instance. Clean slate, every time ๐Ÿงผ๐Ÿ’–

๐Ÿ” -c, --check

Checks the script's syntax without actually running it ๐Ÿง. If the script is invalid, it exits with an error code, so you'll know immediately that something's sus ๐Ÿ’€

๐Ÿ“ -e, --eval string

Evaluates string as JavaScript. Main character energy ๐Ÿ‘‘

๐Ÿฉบ -h, --help

Prints the command-line options ๐Ÿ“‹. Real talk though, the output here is less detailed than this document, so if you want the full tea, read the whole thing ๐Ÿซถ

๐Ÿฃ -i, --interactive

Opens the REPL even when stdin doesn't look like a terminal ๐Ÿ’œ

๐Ÿ–จ๏ธ -p, --print string

Exactly the same as -e, except it also prints the result โœจ

๐Ÿ“ฆ -r, --require module

Preloads the specified module at startup ๐Ÿš€. It follows require()'s module resolution rules, and module can be either a path to a file or a Node.js module name. Very organized, very iconic ๐Ÿ—‚๏ธ

๐Ÿท๏ธ -v, --version

Prints node's version ๐ŸŽ‰


๐ŸŒธ ENVIRONMENT ๐ŸŒธ

Okay so these are the environment variables, and they're giving a lot ๐ŸŒˆ

  • FORCE_COLOR โ€” This turns on ANSI colorized output ๐ŸŽจ. The value can be 1, true, or an empty string for 16-color support, 2 for 256-color support, or 3 for 16 million-color support. When it's used and set to a supported value, both NO_COLOR and NODE_DISABLE_COLORS get ignored. Any other value means colorized output is disabled, no cap ๐Ÿ™…โ€โ™€๏ธ
  • NO_COLOR โ€” Just an alias for NODE_DISABLE_COLORS ๐Ÿค
  • NODE_COMPILE_CACHE dir โ€” Enables the module compile cache for the Node.js instance ๐Ÿ—ƒ๏ธ
  • NODE_DEBUG modules... โ€” A comma-separated list of core modules that should print debug information ๐Ÿ›
  • NODE_DEBUG_NATIVE modules... โ€” A comma-separated list of C++ core modules that should print debug information ๐Ÿ”ง
  • NODE_DISABLE_COMPILE_CACHE โ€” Disables the module compile cache for the Node.js instance ๐Ÿšซ
  • NODE_DISABLE_COLORS โ€” When set to 1, colors won't be used in the REPL ๐Ÿ™Š
  • NODE_EXTRA_CA_CERTS file โ€” When this is set, the well-known "root" CAs (like VeriSign) get extended with the extra certificates in file ๐Ÿ”. The file should contain one or more trusted certificates in PEM format.

If file is missing or misformatted, a message gets emitted once using process.emitWarning(), but any other errors are ignored.

This variable is ignored when node runs as setuid root or has Linux file capabilities set ๐Ÿ™….

NODE_EXTRA_CA_CERTS is only read when the Node.js process first launches. Changing the value at runtime with process.env.NODE_EXTRA_CA_CERTS does absolutely nothing to the current process ๐Ÿ’€

  • NODE_ICU_DATA file โ€” The data path for ICU (Intl object) data ๐ŸŒ. It extends linked-in data when compiled with small-icu support.
  • NODE_NO_WARNINGS โ€” When set to 1, process warnings get silenced ๐Ÿคซ
  • NODE_OPTIONS options... โ€” A space-separated list of command-line options ๐Ÿ“. They're interpreted as if you had typed them on the command line before the actual command, so they can be overridden. Node.js exits with an error if you use an option that isn't allowed in the environment, like --print or a script file ๐Ÿšจ
  • NODE_PATH directories... โ€” A colon-separated list of directories that get prefixed to the module search path ๐Ÿ—บ๏ธ
  • NODE_PENDING_DEPRECATION โ€” When set to 1, pending deprecation warnings get emitted โš ๏ธ
  • NODE_PENDING_PIPE_INSTANCES โ€” Sets the number of pending pipe instance handles while the pipe server is waiting for connections ๐ŸชŸ. This one is Windows only.
  • NODE_PRESERVE_SYMLINKS โ€” When set to 1, the module loader keeps symbolic links intact while resolving and caching modules ๐Ÿ”—
  • NODE_REDIRECT_WARNINGS file โ€” Writes process warnings to the given file instead of printing them to stderr ๐Ÿ“„. It's the same as passing --redirect-warnings file on the command line.
  • NODE_REPL_HISTORY file โ€” The path to the file where persistent REPL history gets stored ๐Ÿ“š. The default is ~/.node_repl_history, but this variable overrides it. Setting it to an empty string ("" or " ") turns persistent REPL history off ๐Ÿšซ
  • NODE_REPL_EXTERNAL_MODULE file โ€” The path to a Node.js module that gets loaded in place of the built-in REPL ๐Ÿงฉ. Setting this to an empty string ('') brings back the built-in REPL.
  • NODE_SKIP_PLATFORM_CHECK โ€” When set to 1, the supported-platform check gets skipped during startup ๐Ÿ™ƒ. Node.js might not run correctly, and any issues on unsupported platforms won't be fixed. Proceed with caution, bestie ๐Ÿ˜ฌ
  • NODE_TEST_CONTEXT โ€” When set to 'child', test reporter options get overridden and the test output goes to stdout in TAP format ๐Ÿงช. If any other value is provided, Node.js makes no guarantees about the reporter format or its stability.
  • NODE_TLS_REJECT_UNAUTHORIZED โ€” When set to 0, TLS certificate validation is disabled ๐Ÿšจ. Yikes, be careful with this one.
  • NODE_USE_ENV_PROXY โ€” When enabled, Node.js parses the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables during startup, and tunnels requests over the specified proxy ๐ŸŒ.

This currently only affects requests sent over fetch(). Support for other built-in http and https methods is still under way ๐Ÿšง

  • NODE_USE_SYSTEM_CA โ€” Similar to --use-system-ca ๐Ÿ›๏ธ. It uses the trusted CA certificates in the system store, on top of the certificates in the bundled Mozilla CA store and the certificates from NODE_EXTRA_CA_CERTS.
  • NODE_V8_COVERAGE dir โ€” When set, Node.js writes JavaScript code coverage information to dir ๐Ÿ“Š
  • OPENSSL_CONF file โ€” Loads an OpenSSL configuration file on startup ๐Ÿ”‘. Among other uses, this can enable FIPS-compliant crypto if Node.js is built with ./configure --openssl-fips.

If the --openssl-config command-line option is used, this environment variable gets ignored.

  • SSL_CERT_DIR dir โ€” If --use-openssl-ca is enabled, this overrides and sets OpenSSL's directory containing trusted certificates ๐Ÿ“
  • SSL_CERT_FILE file โ€” If --use-openssl-ca is enabled, this overrides and sets OpenSSL's file containing trusted certificates ๐Ÿ“œ
  • TZ โ€” Specifies the timezone configuration ๐Ÿ•ฐ๏ธ
  • UV_THREADPOOL_SIZE size โ€” Sets the number of threads used in libuv's threadpool to size ๐Ÿงต

๐Ÿ› BUGS ๐Ÿ›

Bugs are tracked in GitHub Issues over at https://github.com/nodejs/node/issues ๐Ÿชฒ

Copyright Node.js contributors. Node.js is available under the MIT license ๐Ÿ’Œ

Node.js also includes external libraries that are available under a variety of licenses. See https://github.com/nodejs/node/blob/HEAD/LICENSE for the full license text ๐Ÿ“–

๐Ÿ”— SEE ALSO ๐Ÿ”—


That's the whole page, bestie! ๐Ÿงšโœจ Stamped 2018 and filed under NODE(1), so it's officially a vintage classic now ๐Ÿ’…๐ŸŒธ

๐Ÿ“ฆ where this page comes from
  • fedora 44: nodejs22 1:22.22.0-7.fc44 ยท Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
  • fedora 44: nodejs22 1:22.22.0-7.fc44 ยท Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
  • fedora 44: nodejs22 1:22.23.1-2.fc44 ยท Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
  • fedora 44: nodejs22 1:22.23.1-2.fc44 ยท Apache-2.0 AND Artistic-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-3.0 AND CC0-1.0 AND ISC AND MIT
  • ๐Ÿ’– girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms