Skip to main content
Process.loadEnvFile - node__process.d.ts - Node documentation
method Process.loadEnvFile

Usage in Deno

```typescript import { type Process } from "node:node__process.d.ts"; ```
Process.loadEnvFile(path?:
string
| URL
| Buffer
): void
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: ```js import { loadEnvFile } from 'node:process'; loadEnvFile('./development.env') ```

Parameters

optional
path:
string
| URL
| Buffer
The path to the .env file

Return Type

void