The Node.js Runtime v8 options list

By

Published · Updated

Tagged: Node.js

A reference list of useful Node.js runtime and V8 engine options you can pass when starting a program, from --optimize-for-size to language feature flags.

Node.js can be invoked with an incredibly various set of options.

Most of those options configure the V8 engine behavior.

The Default column uses the same notation as node --v8-options: --no-expose-gc means the flag is off by default, --harmony-shipping means it is on. You enable a flag by passing it, for example node --expose-gc.

If an option is enabled by default, you can disable it by prepending --no- to the flag name, for example node --no-harmony-shipping.

Some can be used to optimize performance, like --optimize-for-size and --max-old-space-size.

Some others are used to enable or disable specific features. I used them to try out new proposed JavaScript features before they shipped, like class fields with --harmony-public-fields back when I first wrote this. Those flags are now named --js-*. On Node.js 26, for example, node --js-sum-precise turns on Math.sumPrecise, which is off by default.

Note: options names allow words to be separated by both dashes (-) or underscores (_), or a mix of those. On tutorials you’ll find a mix of both, so it can be confusing. There is no difference.

I originally got the full list by running node --v8-options on Node.js 11.9.0. That list changes with every Node release, and on Node.js 26.9.0 the command prints 971 flags, so run it on your own Node binary for the complete dump.

Here is a shorter list of the useful ones, taken from node --v8-options on Node.js 26.9.0 (the Default column shows what that version prints):

Option Description Type Default
--use-strict enforce strict mode bool —no-use-strict
--harmony enable all completed harmony features bool —no-harmony
--harmony-shipping enable all shipped harmony features bool —harmony-shipping
--js-staging enable all completed JavaScript features bool —no-js-staging
--js-shipping enable all shipped JavaScript features bool —js-shipping
--harmony-temporal enable Temporal bool —harmony-temporal
--harmony-import-attributes enable import attributes bool —harmony-import-attributes
--harmony-shadow-realm enable ShadowRealm (experimental) bool —no-harmony-shadow-realm
--js-decorators enable decorators (experimental) bool —no-js-decorators
--js-promise-try enable Promise.try bool —js-promise-try
--js-error-iserror enable Error.isError bool —js-error-iserror
--js-regexp-escape enable RegExp.escape bool —js-regexp-escape
--js-explicit-resource-management enable explicit resource management bool —js-explicit-resource-management
--js-base-64 enable Uint8Array base64/hex helpers bool —js-base-64
--js-atomics-pause enable Atomics.pause bool —js-atomics-pause
--js-sum-precise enable Math.sumPrecise bool —no-js-sum-precise
--optimize-for-size favor memory size over execution speed bool —no-optimize-for-size
--max-old-space-size max size of the old space (in Mbytes) size_t —max-old-space-size=0
--stack-size default V8 stack size (in kBytes) int —stack-size=984
--print-bytecode print Ignition bytecode bool —no-print-bytecode
--trace-gc print a line after each garbage collection bool —no-trace-gc
--expose-gc expose the gc() extension bool —no-expose-gc

Defaults move between releases as features ship. On Node.js 24 (the LTS line) --harmony-temporal and --js-base-64 are still off by default, and --js-sum-precise does not exist yet. Also note that --js-decorators is marked “in progress” in V8, so decorator syntax still fails to parse on Node.js 26 even with the flag on.

If you want to inspect the V8 version bundled with your Node installation, see how to check the Node.js version at runtime (process.versions.v8).

Want me to talk about your product? You can sponsor this site.

Related posts about node: