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.

Readme

Keywords

Package Sidebar

Install

npm i env-expander

Weekly Downloads

1

Version

0.0.1

License

ISC

Last publish

Collaborators

  • msiebuhr