Home >>Nodejs Tutorial >Node.js Command Line Options

Node.js Command Line Options

Node.js Command Line Options

Node.js includes a large variety of command line options. Such tools provide many methods to execute scripts and other important run-time choices.

Let's see a list of options in the Node.js command line:

Index Option Description
1 v,--version It is used to print a version of the node.
2 -h,--help It is used to print command line options for nodes.
3 -e,--eval"script As JavaScript it evaluates the following argument. The modules that are predefined in the REPL can be used in script as well.
4 -p, --print "script" It is similar to -e but the result is print.
5 -c, --check Syntax script checks without execution.
6 -i, --interactive It opens the REPL even though stdin doesn't seem a terminal.
7 -r, --require module It is used on startup to preload the required module. It follows the rules for module resolution in require). Node may either be the path to a file or the name of a node node.
8 --no-deprecation Warnings of silence for the deprecation.
9 --trace-deprecation This is used for the interpretation of deprecations stack remains.
10 --throw-deprecation It throws the deprecations for errors.
11 --no-warnings It silences all alerts (including deprecations) about the operation.
12 --trace-warnings It prints stack traces (including the deprecations) for process alerts.
13 --trace-sync-io Whenever synchronous I / o is detected after the first turn of the event loop it prints a stack trace.
14 --zero-fill-buffers Both newly allocated buffer and slowbuffer instances are simultaneously zero-filled.
15 --track-heap-objects It monitors allocations of heap objects to heap snapshots.
16 --prof-process It processes output generated from the V8 profiler using the —prof method.
17 --V8-options It prints options on command line V8.
18 --tls-cipher-list=list It defines an alternate cipher list with the default tls. (Building node.js with crypto support (default))
19 --enable-fips Makes fips-compliant crypto at startup. (Node.js needed to be installed with the./configure —openssl-fips function)
20 --force-fips On startup it forces crypto compliant with fips. (Can't be disabled from script code.) (same specifications as —enable-fips)
21 --icu-data-dir=file The ICU data load path is defined. (Overrides the icu data node)

Node.js Command Line Options Examples

To see the version of the running Node:

Open the Node.js command prompt and run the -v or —version command node

Command line node.js

For Help:

Use command node ?h or node –help

Command line node.js

To evaluate an argument (but not print result):

Use command node -e, --eval "script"

To evaluate an argument and print result also:

Use command node -p "script"

Command line node.js

To open REPL even if stdin doesn't appear:

Use command node -i, or node --interactive


No Sidebar ads