envv
Simple util for config files that checks and returns an env var.
Installation
$ npm install envv
Usage
// config.jsconst envv = ; moduleexports = listenAddr: // (1) listenPort: // (2);
listenAddr
will beprocess.env.ADDR
or127.0.0.1
- if
process.env.PORT
is not given,Error: env var 'PORT' is missing
will be thrown