envv
Simple util for config files that checks and returns an env var.
Last updated 2 years ago by aluxian .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install envv 
SYNC missed versions from official npm registry.

envv

CircleCI codecov js-semistandard-style npm License MIT Bitcoin Donate

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

Installation

$ npm install envv

Usage

// 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.1
  2. if process.env.PORT is not given, Error: env var 'PORT' is missing will be thrown

Current Tags

  • 1.2.0                                ...           latest (2 years ago)

4 Versions

  • 1.2.0                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (4)
Dependents (3)

Copyright 2014 - 2017 © taobao.org |