Thursday, July 12, 2018

javascript - Read environment variables in Node.js



Is there a way to read environment variables in Node.js code?



Like for example Python's os.environ['HOME'].


Answer



process.env.ENV_VARIABLE



Where ENV_VARIABLE is the name of the variable you wish to access.



See Node.js docs for process.env.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...