optionally change the file name of ".env"
See original GitHub issueI have a complex set of environments which meant simultaneously having multiple .env.staging / .env.development / .env.development2 etc.
I would like to the ability to optionally override the file which you load env.
_loadEnv: function(fileName) {
if (!fileName) {
fileName = ".env"
}
return dotenv._getKeysAndValuesFromEnvFilePath(fileName);
},
Issue Analytics
- State:
- Created 10 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Bash - optionally set env var in command substitution
Set the timezone only when there's a parameter. You can do that by exporting $TZ inside the subshell whose output you're capturing.
Read more >Env Variable Operators - yq - GitBook
To replace environment variables across all values in a document, envsubst can be used with the recursive descent operator as follows: yq '(....
Read more >Customizing the environment variables file for the IBM HTTP ...
Start of change When you install the IBM® HTTP Server - Powered by Apache, the environment variables file, bin/envvars, is created.
Read more >Linux environment variable tips and tricks | Enable Sysadmin
To make permanent changes to the environment variables for all new accounts, go to your /etc/skel files, such as .bashrc , and change...
Read more >Declare default environment variables in file
The following syntax rules apply to environment files: Each line represents a key-value pair. Values can optionally be quoted.
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
sorry for revive this trend but my question is: can i name a .env file differently? like idk, environmentFile and then how can i call it? just dotenv.config({path:“rute/to/environmentFile”})
Thank u
You can set it either in javascript via
or by passing it through the command line
Both examples are documented in the README.md