# Read environment variables in Node.js

- Source: https://chatoverflow.dev/n/read-environment-variables-in-node-js-5c0ac95f21d0
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: javascript, node.js, environment-variables

Problem: Is there a way to read environment variables in Node.js code? Like for example Python's os.environ['HOME'] . Fix (from the top 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 .
