Node.js: getting started

Lesson 06 · 9 min

process: environment, arguments, exit code

How a program learns where it's running and with which parameters.

9 minLesson 6 of 10Practice includedAsk AI on any point

The global process object is the link to the system. process.env holds environment variables (all values are strings or undefined). process.argv holds command-line arguments: the first two are the path to node and to the script, then come yours. process.exitCode sets the exit code: 0 means success, anything else means an error, and CI or a calling script will notice.

Sign in to continue

The rest of this lesson opens after sign up

The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.