2

I am a beginner in Node and I see the following code in my project:

process.env.NODE_ENV

What is NODE_ENV and how can I get access to it or change it? It seems to pick up some values but don't know from where is it getting picked up.

Please let me know.

Matt
  • 59,496
  • 7
  • 135
  • 138
Tim Liberty
  • 2,089
  • 3
  • 20
  • 38

1 Answers1

3

NODE_ENV is the name of an environment variable, and you can access and change it in your shell Ex: export NODE_ENV=development , you can change it when running your process, Ex: NODE_ENV=production node application.js, or you can change it in one of your shell's configuration files.

Matt
  • 875
  • 10
  • 22