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

More getting started commands

All getting started commands · Node.js 24 cheatsheet

Was this page helpful?