process.loadEnvFile()

A Node.js function that loads a .env file into process.env from inside your program, doing what --env-file does on the command line.

In more detail

Called with no argument it reads ./.env. It is useful when the file to load depends on logic in the program.

Related terms

Taught in

References