Home Node.js Node.js Command Line Options

Node.js Command Line Options

There are a variety of command line options for Node.js

Lets take a look at the list of Node.js command line options:

Option Description
v, –version This is used to print node’s version.
-h, –help This is used to print node command line options.
-e, –eval “script” This evaluates the following argument as JavaScript. The modules which are predefined in the REPL can also be used in script.
-p, –print “script” This is identical to -e but prints the result.
-c, –check Syntax check the script without executing.
-i, –interactive This opens the REPL even if stdin does not appear to be a terminal.
-r, –require module This is used to preload the specified module at startup. It follows require()’s module resolution rules. Module may be either a path to a file, or a node module name.
–no-deprecation Silence deprecation warnings.
–trace-deprecation This is used to print stack traces for deprecations.
–throw-deprecation This throws errors for deprecations.
–no-warnings This will silence all process warnings (this includes deprecations).
–trace-warnings This prints stack traces for process warnings (this includes deprecations).
–trace-sync-io This prints a stack trace whenever synchronous i/o is detected after the first turn of the event loop.
–zero-fill-buffers Automatically zero-fills all newly allocated buffer and slow buffer instances.
–track-heap-objects This tracks heap object allocations for heap snapshots.
–prof-process This processes V8 profiler output generated using the v8 option –prof.
–V8-options This prints V8 command line options.
–tls-cipher-list=list This specifies an alternative default tls cipher list. (this requires node.js to be built with crypto support. (default))
–enable-fips It enables fips-compliant crypto at startup. (this requires node.js to be built with ./configure –openssl-fips)
–force-fips This forces fips-compliant crypto on startup. (this cannot be disabled from script code.) (it has the same requirements as –enable-fips)
–icu-data-dir=file This specifies ICU data load path. (Overrides node_icu_data)

You may also like