[feature] Implement dotenv-expand to accept variable expansion in dot env files
See original GitHub issueCurrently we use the dotenv
library to parse a .env
file in the project root and populate process.env
. Great!
Although there exists scenarios in large scale deployments where the same environment variables are used accross many “app” or “services” or “containers”… For example
We have websites, API services and databases consuming a base set of environment variables such as:
CDN
STRIPE_KEY
API_HOST
VERSION_TAG
We don’t want to have to add another set to this simply with the leading key REACT_APP_XXX
. Dotenv has a has a sister project / plugin called dotenv-expand that allows, wait for it… variable expansion in the file! e.g.
REACT_APP_CDN=${CDN}
REACT_APP_STRIPE_KEY=${STRIPE_KEY}
REACT_APP_API_HOST=${API_HOST}
REACT_APP_VERSION_TAG=${VERSION_TAG}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:8 (6 by maintainers)
Top Results From Across the Web
motdotla/dotenv-expand: Variable expansion for ... - GitHub
Dotenv -expand adds variable expansion on top of dotenv. If you find yourself needing to expand environment variables already existing on your machine, ......
Read more >Master environment variables on Node.js with dotenv-expand
Dotenv -expand is an NPM library that adds variable expansion on top of the dotenv library we used before. It allows us to...
Read more >Correct way to use dotenv-expand (.env) - Stack Overflow
Is it correct way to use dotenv-expand ? If so , it doens't work in my case . I want to create variable...
Read more >Top 5 dotenv-expand Code Examples - Snyk
To help you get started, we've selected a few dotenv-expand examples, based on popular ways it is used in public projects. Secure your...
Read more >Dotenv - Best of JS
Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env . Storing configuration in the environment separate ...
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 FreeTop 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
Top GitHub Comments
This is out in
react-scripts@1.1.0
! Please let us know if something doesn’t quite work. https://github.com/facebookincubator/create-react-app/releases/tag/v1.1.0FYI, to include an underscore in your expression use the
${ }
format in your.env
:where