Environment Variables
The process.env
property contains the environment variables of the NodeJS process. It provides access to system-specific information such as user environment variables, system configuration, and runtime environment details.
console.log(process.env.NODE_ENV);
// Output: 'development'
What is the purpose of the process object in Node JS ?
In NodeJS, the process
object is a global object that provides access to information and control over the current NodeJS process. It offers various properties and methods to interact with the underlying operating system environment and manage the NodeJS process effectively. Let’s explore the primary purposes of the process
object in NodeJS.
Contact Us