Skip to content

docs(dotenv): suggest process.loadEnvFile as native replacement#815

Open
unrevised6419 wants to merge 3 commits into
e18e:mainfrom
unrevised6419:dotenv-load-env-file
Open

docs(dotenv): suggest process.loadEnvFile as native replacement#815
unrevised6419 wants to merge 3 commits into
e18e:mainfrom
unrevised6419:dotenv-load-env-file

Conversation

@unrevised6419

Copy link
Copy Markdown

What

Adds process.loadEnvFile(path) (Node.js v20.12.0+) as the first suggested native replacement in the dotenv docs.

It is the closest drop-in for dotenv.config() when env vars must be loaded programmatically rather than via the --env-file flag.

Verified

Behavior claims checked empirically on Node v24.16.0:

  • Throws ENOENT when the file is missing.
  • Defaults to .env in the current working directory when called with no path.

Closes #620

🤖 Generated with Claude Code

Adds process.loadEnvFile(path) (Node.js v20.12.0+) as the first suggested
native replacement in the dotenv docs. It is the closest drop-in for
dotenv.config() for programmatic loading.

Closes e18e#620

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@gameroman gameroman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add process.loadEnvFile to the manifest please

Comment thread docs/modules/dotenv.md Outdated
Comment thread docs/modules/dotenv.md Outdated
Addresses PR review: registers process.loadEnvFile as a native
replacement entry and lists it for the dotenv mapping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@unrevised6419

Copy link
Copy Markdown
Author

Done — added process.loadEnvFile as a native replacement entry and listed it for the dotenv mapping. Manifest validation + prettier pass.

Adopt reviewer heading style and trim the description per PR review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@unrevised6419
unrevised6419 requested a review from gameroman July 16, 2026 11:32
@dreyfus92

dreyfus92 commented Jul 17, 2026

Copy link
Copy Markdown
Member

@gameroman if this is a native replacement, shouldn't this live within the native manifest instead of preferred?

@gameroman

Copy link
Copy Markdown
Contributor

@gameroman if this is a native replacement, shouldn't this live within the native manifest instead of preferred?

Do you mean process.loadEnvFile or the whole thing?

I think it's in the preferred manifest because it has docs, and previously we didn't have node-native replacements

@43081j

43081j commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

@unrevised6419 before we merge this, can you come say Hi so we can interact with you rather than your agent.

these days it is important we know we're dealing with a person since some of these things lead to rep farming etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotenv] Additionally suggest process.loadEnvFile(path)

4 participants