Node.js 24 · Getting started
Load environment variables from a file
Read variables from a .env file into process.env before the script starts.
node --env-file=.env app.js
Official Node.js 24 documentation
Node.js 24 · Getting started
Read variables from a .env file into process.env before the script starts.
node --env-file=.env app.js
Official Node.js 24 documentation
Was this page helpful?