method Process.loadEnvFile
Process.loadEnvFile(path?: string
| URL
| Buffer): void
Deprecated
Loads the environment configuration from a .env
file into process.env
. If
the file is not found, error will be thrown.
To load a specific .env file by specifying its path, use the following code:
import { loadEnvFile } from 'node:process';
loadEnvFile('./development.env')
void