Skip to content

Commit c7c0ee6

Browse files
committed
doc: clarify loadEnvFile precedence
Signed-off-by: Sam Yao <43796777+yaohuangguan@users.noreply.github.com>
1 parent fbbf534 commit c7c0ee6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎doc/api/process.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,8 +2723,10 @@ changes:
27232723
27242724
* `path` {string | URL | Buffer | undefined}. **Default:** `'./.env'`
27252725
2726-
Loads the `.env` file into `process.env`. Usage of `NODE_OPTIONS`
2727-
in the `.env` file will not have any effect on Node.js.
2726+
Loads the `.env` file into `process.env`. If a variable is already defined in
2727+
`process.env`, its existing value takes precedence and is not overwritten by the
2728+
`.env` file. Usage of `NODE_OPTIONS` in the `.env` file will not have any effect
2729+
on Node.js.
27282730
27292731
```cjs
27302732
const { loadEnvFile } = require('node:process');

0 commit comments

Comments
 (0)