process.env
noun
say it: “PROS-es dot EN-vee” /ˈprɑsɛs dɑt ˈɛnvi/
An object in Node that holds the environment variables the program was started with, such as its port or database address.
What does process.env do?
process.env holds environment variables, such as the port or a database URL.
const port = process.env.PORT ?? 3000;
In a sentence
- “The server reads its port from process.env.PORT.”
- “Keep the database password in process.env, never in the code.”
Level: Apprentice · More Node.js terms at this level
Updated