diff --git a/doc/api/process.md b/doc/api/process.md index df7af5feaa92f9..587b9c499fd00b 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -2260,6 +2260,29 @@ process.kill(process.pid, 'SIGHUP'); When `SIGUSR1` is received by a Node.js process, Node.js will start the debugger. See [Signal Events][]. +## `process.loadEnvFile(path)` + + + +> Stability: 1.1 - Active development + +* `path` {string | undefined} + +Loads the `.env` file into `process.env`. By default, the path is resolved to +`path.resolve(process.cwd(), '.env')`. If file is not found, no error is thrown. + +```cjs +const { loadEnvFile } = require('node:process'); +loadEnvFile(); +``` + +```mjs +import { loadEnvFile } from 'node:process'; +loadEnvFile(); +``` + ## `process.mainModule`