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
  • 68,711
  • 7
  • 155
  • 158
Tim Liberty
  • 2,099
  • 4
  • 23
  • 39

1 Answers1

4

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
  • 978
  • 10
  • 24