The process Module

Learn about the process module.

Overview

The process object provides information about the current Node.js process and allows the program to interact with it.

The process is a global object, so it can be accessed anywhere inside our Node.js applications without using require().

Now, we’ll look at a few common process properties, such as .argv and .env.

Access CLI arguments

The process.argv property allows us to access the values passed into the application from the command line. It stores the values in an array.

Follow the steps below to see how this works:

  1. Add the following code to the process.js file:

Get hands-on with 1400+ tech skills courses.