Nodejs subprocesses

From wikinotes
Revision as of 02:11, 21 June 2021 by Will (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

CLI Args

process.argv  // array of cli arguments

Environment Variables

process.env.FOO  // access envvar 'FOO'

Exit Codes

process.exit(1)       # terminate with exit code 1
process.exitCode = 1  # use exitcode at termination

Signals

let pid = 1234
process.kill(pid, 'SIGTERM')