dotenv-expand
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.
![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)
Install
npm install @chatopera/dotenv --save
Usage
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.
require('@chatopera/dotenv').config(process.cwd() + '/.env')
process.env["YOUR_ENV_VAR"]
See test/.env for examples of variable expansion in your .env
file.