Skip to content

doc: clarify variable precedence in process.loadEnvFile() - #66321

Open
Sepandard wants to merge 1 commit into
nodejs:mainfrom
Sepandard:doc-loadenvfile-precedence
Open

Sepandard wants to merge 1 commit into
nodejs:mainfrom
Sepandard:doc-loadenvfile-precedence

Conversation

@Sepandard

@Sepandard Sepandard commented Sep 26, 2026 •

Copy link
Copy Markdown

Document that process.loadEnvFile() does not overwrite variables that already exist in process.env, including ones set by a previous call, and that this differs from multiple --env-file flags where later files win. Show how to override values using util.parseEnv().

Fixes: #66315

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. process Issues and PRs related to the process subsystem. labels Sep 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

@Sepandard
Sepandard force-pushed the doc-loadenvfile-precedence branch 5 times, most recently from 182e380 to 009d9c2 Compare September 26, 2026 15:22
Document that process.loadEnvFile() does not overwrite variables that
already exist in process.env, including ones set by a previous call,
and that this differs from multiple --env-file flags where later files
win. Show how to override values using util.parseEnv().

Fixes: nodejs#66315
Signed-off-by: Sepandar Derakhshandeh <sepandar.derakhshandeh@gmail.com>
@Sepandard
Sepandard force-pushed the doc-loadenvfile-precedence branch from 009d9c2 to 6059406 Compare September 27, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to Node.js documentation. process Issues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs] process.loadEnvFile() does not document behaviour when variables already exist

2 participants