https://github.com/msiebuhr/node-env-expander
https://github.com/msiebuhr/node-env-expander
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/msiebuhr/node-env-expander
- Owner: msiebuhr
- Created: 2015-01-26T11:50:18.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-04T07:35:45.000Z (about 10 years ago)
- Last Synced: 2025-01-17T06:45:28.522Z (4 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/env-expander
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
env-expander
============Enriches your configuration with environment variables;
Given the environment variables `$USERNAME=root` and `$PASSWORD=123456`, the following configuration
envExpander.expander({
"username": "ENV:$USERNAME",
"password": "ENV:$PASSWORD",
"loginUrl": "https://api.example.com/login"
});Will expand to this object:
{
"username": "root",
"password": "123456",
"loginUrl": "https://api.example.com/login"
}API
---`.expander(obj, options)` will recursively expand values `obj` matching
`ENV:$ENV_VAR_NAME`. If `options.env` is given, then lookups will happen there
instead of `process.env`.