Simple util for config files that checks and returns an env var.
npm install envv





Simple util for config files that checks and returns an env var.
``sh`
$ npm install envv
`js
// config.js
const envv = require('envv');
module.exports = {
listenAddr: envv('ADDR', '127.0.0.1'), // (1)
listenPort: envv('PORT') // (2)
};
`
1. listenAddr will be process.env.ADDR or 127.0.0.1process.env.PORT
2. if is not given, Error: env var 'PORT' is missing` will be thrown