-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
dotenvIssues and PRs related to .env file parsingIssues and PRs related to .env file parsingfeature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Description
What is the problem this feature will solve?
#50588 introduced a throw if a requested env file isn't found. When dealing with multiple environments, a .env file may sometimes be merely optional - and throwing isn't desired. For example, during local development, devs might keep variables in a .env
file, which isn't committed to source control, while in production, these variables come from the environment. This option will allow the env file to be loaded only if it exists without changing the command used to invoke node between environments.
What is the feature you are proposing to solve the problem?
Add a flag (or other mechanism) to indicate that the .env file should be loaded only it's found, and to throw otherwise.
What alternatives have you considered?
touch
ing .env
before running node; invoking node via a shell script and "building up" the cli opts.
alexgwolff, acidoxee, sosoba, Ricki-BumbleDev, JonasDoe and 24 morekravetsone
Metadata
Metadata
Assignees
Labels
dotenvIssues and PRs related to .env file parsingIssues and PRs related to .env file parsingfeature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.