question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supporting Multiple env files

See original GitHub issue

Hi, 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:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
joshmeadscommented, May 10, 2022

Also take a look at 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.

@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 👍🏻

0reactions
motdotlacommented, Apr 24, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found