The Node.js Runtime v8 options list

By

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):

OptionDescriptionTypeDefault
--use-strictenforce strict modebool—no-use-strict
--harmonyenable all completed harmony featuresbool—no-harmony
--harmony-shippingenable all shipped harmony featuresbool—harmony-shipping
--js-stagingenable all completed JavaScript featuresbool—no-js-staging
--js-shippingenable all shipped JavaScript featuresbool—js-shipping
--harmony-temporalenable Temporalbool—harmony-temporal
--harmony-import-attributesenable import attributesbool—harmony-import-attributes
--harmony-shadow-realmenable ShadowRealm (experimental)bool—no-harmony-shadow-realm
--js-decoratorsenable decorators (experimental)bool—no-js-decorators
--js-promise-tryenable Promise.trybool—js-promise-try
--js-error-iserrorenable Error.isErrorbool—js-error-iserror
--js-regexp-escapeenable RegExp.escapebool—js-regexp-escape
--js-explicit-resource-managementenable explicit resource managementbool—js-explicit-resource-management
--js-base-64enable Uint8Array base64/hex helpersbool—js-base-64
--js-atomics-pauseenable Atomics.pausebool—js-atomics-pause
--js-sum-preciseenable Math.sumPrecisebool—no-js-sum-precise
--optimize-for-sizefavor memory size over execution speedbool—no-optimize-for-size
--max-old-space-sizemax size of the old space (in Mbytes)size_t—max-old-space-size=0
--stack-sizedefault V8 stack size (in kBytes)int—stack-size=984
--print-bytecodeprint Ignition bytecodebool—no-print-bytecode
--trace-gcprint a line after each garbage collectionbool—no-trace-gc
--expose-gcexpose the gc() extensionbool—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 install, see how to check the Node.js version at runtime (process.versions.v8).

Tagged: Node.js · All topics

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

~~~

Related posts about node: