Expand environment variables using dotenv
npm install @chatopera/dotenv
Dotenv-expand adds variable expansion on top of
dotenv. If you find yourself needing to
expand environment variables already existing on your machine, then
dotenv-expand is your tool.



``bash`
npm install @chatopera/dotenv --save
Define vars in .env
``
OTHER_ENV=foo
YOUR_ENV_VAR=$OTHER_ENV/bar
As early as possible in your application, require dotenv and dotenv-expand, and
wrap dotenv expand around dotenv.
`js`
require('@chatopera/dotenv').config(process.cwd() + '/.env')
process.env["YOUR_ENV_VAR"]
See test/.env for examples of variable expansion in your .env`
file.