Supporting Multiple env files
See original GitHub issueHi,
I would love to request for a feature enhancement whereas dotenv/config
would be able to load multiple env files.
node -r dotenv/config .env .local.env index.js
Would this be possible?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Using multiple .env files. - Prisma
One solution is to have multiple .env files which each represent different environments. In practice this means you create a file for each...
Read more >Toggle between multiple .env files like .env.development with ...
The official doc of dotenv does not recommend having multiple .env files. "Should I have multiple .env ...
Read more >How to Handle Multiple Environments in NodeJS - Dev Genius
The most straightforward way to use environment variables is using our package.json file. Let's create two commands just to demonstrate two environments. " ......
Read more >Node JS Environment Variables — Setting Node app for ...
Configuring environment variables to a separate file rather than in our node js code enables us to run and point our app to...
Read more >Support multiple .env files #7326 - docker/compose - GitHub
Multiple file support is implemented for docker run and as env_file docker-compose property and it works well for environment variables in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@motdotla I found dotenv-vault a few days after posting on this issue, I’d agree @hitmands it’s the better solution. Both should hopefully solve the issue though 👍🏻
Also take a look at https://github.com/dotenv-org/dotenv-vault
I used to use flow but found it can get a bit confusing. That led to us building out dotenv-vault - among other things.