env-expander

0.0.1 • Public • Published

env-expander

Enriches your configuration with environment variables;

$USERNAME=root
$PASSWORD=123456
envExpander.expand({
    "username": "ENV:$USERNAME",
    "password": "ENV:$PASSWORD",
    "loginUrl": "https://api.example.com/login"
});

=

{
    "username": "root",
    "password": "123456",
    "loginUrl": "https://api.example.com/login"
}

API

.expand(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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    0

Package Sidebar

Install

npm i env-expander

Weekly Downloads

0

Version

0.0.1

License

ISC

Last publish

Collaborators

  • msiebuhr