Skip to main content

Module cli

Module cli 

Source
Expand description

Command-line interface for the node binary.

Structs§

Argv
How Node divides the command line, which is NOT the raw argv the OS handed over: the flags the RUNTIME consumed go to process.execArgv, and process.argv is [execPath, entryScript, ...userArgs] with those flags removed. The split is entry-point dependent and observably so — node -e 'src' z reports execArgv = ["-e","src"] and argv = [exec,"z"], with NO argv[1], while node s.js z reports execArgv = [] and argv = [exec, "/abs/s.js", "z"]. Measured on node v26.7.0.
Cli

Functions§

parse
Parse the process arguments.
split_argv
Compute Argv from the raw command line.