{ "source": "doc/api/cli.md", "miscs": [ { "textRaw": "Command Line Options", "name": "Command Line Options", "type": "misc", "desc": "
Node.js comes with a wide variety of CLI options. These options expose built-in\ndebugging, multiple ways to execute scripts, and other helpful runtime options.\n\n
\nTo view this documentation as a manual page in your terminal, run man node
.\n\n\n
node [options] [v8 options] [script.js | -e "script"] [arguments]
\n\n
node debug [script.js | -e "script" | <host>:<port>] …
\n\n
node --v8-options
\n\n
Execute without arguments to start the [REPL][].\n\n
\nFor more info about node debug
, please see the [debugger][] documentation.\n\n\n
Print node's version.\n\n\n
\n", "type": "module", "displayName": "`-v`, `--version`" }, { "textRaw": "`-h`, `--help`", "name": "`-h`,_`--help`", "desc": "Print node command line options.\nThe output of this option is less detailed than this document.\n\n\n
\n", "type": "module", "displayName": "`-h`, `--help`" }, { "textRaw": "`-e`, `--eval \"script\"`", "name": "`-e`,_`--eval_\"script\"`", "desc": "Evaluate the following argument as JavaScript. The modules which are\npredefined in the REPL can also be used in script
.\n\n\n
Identical to -e
but prints the result.\n\n\n
Syntax check the script without executing.\n\n\n
\n", "type": "module", "displayName": "`-c`, `--check`" }, { "textRaw": "`-i`, `--interactive`", "name": "`-i`,_`--interactive`", "desc": "Opens the REPL even if stdin does not appear to be a terminal.\n\n\n
\n", "type": "module", "displayName": "`-i`, `--interactive`" }, { "textRaw": "`-r`, `--require module`", "name": "`-r`,_`--require_module`", "desc": "Preload the specified module at startup.\n\n
\nFollows require()
's module resolution\nrules. module
may be either a path to a file, or a node module name.\n\n\n
Silence deprecation warnings.\n\n\n
\n", "type": "module", "displayName": "`--no-deprecation`" }, { "textRaw": "`--trace-deprecation`", "name": "`--trace-deprecation`", "desc": "Print stack traces for deprecations.\n\n\n
\n", "type": "module", "displayName": "`--trace-deprecation`" }, { "textRaw": "`--throw-deprecation`", "name": "`--throw-deprecation`", "desc": "Throw errors for deprecations.\n\n
\n", "type": "module", "displayName": "`--throw-deprecation`" }, { "textRaw": "`--no-warnings`", "name": "`--no-warnings`", "desc": "Silence all process warnings (including deprecations).\n\n
\n", "type": "module", "displayName": "`--no-warnings`" }, { "textRaw": "`--trace-warnings`", "name": "`--trace-warnings`", "desc": "Print stack traces for process warnings (including deprecations).\n\n
\n", "type": "module", "displayName": "`--trace-warnings`" }, { "textRaw": "`--trace-sync-io`", "name": "`--trace-sync-io`", "desc": "Prints a stack trace whenever synchronous I/O is detected after the first turn\nof the event loop.\n\n\n
\n", "type": "module", "displayName": "`--trace-sync-io`" }, { "textRaw": "`--zero-fill-buffers`", "name": "`--zero-fill-buffers`", "desc": "Automatically zero-fills all newly allocated [Buffer][] and [SlowBuffer][]\ninstances.\n\n\n
\n", "type": "module", "displayName": "`--zero-fill-buffers`" }, { "textRaw": "`--track-heap-objects`", "name": "`--track-heap-objects`", "desc": "Track heap object allocations for heap snapshots.\n\n\n
\n", "type": "module", "displayName": "`--track-heap-objects`" }, { "textRaw": "`--prof-process`", "name": "`--prof-process`", "desc": "Process v8 profiler output generated using the v8 option --prof
.\n\n\n
Print v8 command line options.\n\n\n
\n", "type": "module", "displayName": "`--v8-options`" }, { "textRaw": "`--tls-cipher-list=list`", "name": "`--tls-cipher-list=list`", "desc": "Specify an alternative default TLS cipher list. (Requires Node.js to be built\nwith crypto support. (Default))\n\n\n
\n", "type": "module", "displayName": "`--tls-cipher-list=list`" }, { "textRaw": "`--enable-fips`", "name": "`--enable-fips`", "desc": "Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with\n./configure --openssl-fips
)\n\n\n
Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.)\n(Same requirements as --enable-fips
)\n\n\n
Specify ICU data load path. (overrides NODE_ICU_DATA
)\n\n\n
','
-separated list of core modules that should print debug information.\n\n\n
':'
-separated list of directories prefixed to the module search path.\n\n
Note: on Windows, this is a ';'
-separated list instead.\n\n\n
When set to 1
colors will not be used in the REPL.\n\n\n
Data path for ICU (Intl object) data. Will extend linked-in data when compiled\nwith small-icu support.\n\n\n
\n", "type": "module", "displayName": "`NODE_ICU_DATA=file`" }, { "textRaw": "`NODE_REPL_HISTORY=file`", "name": "`node_repl_history=file`", "desc": "Path to the file used to store the persistent REPL history. The default path is\n~/.node_repl_history
, which is overridden by this variable. Setting the value\nto an empty string (""
or " "
) disables persistent REPL history.\n\n\n