0.3.1 • Published 8 years ago

enviro-conf v0.3.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Environment Configuration

A simple node.js environment variable config loader inspired by The Twelve Factor App

Build
Status Coverage Status npm version

Installation

$ npm install enviro-conf --save

Usage

Setup environment variables:

$ export PORT=3000 FEATURE=something

Accessing config properties:

var config = require('enviro-conf');
//...
var port = config.get('PORT');
server.listen(port, ...);

config.get() will throw an exception for undefined keys to help catch typos and missing values.

Check if config properties exist:

var config = require('enviro-conf');
//...
if (config.has('FEATURE')) {
  var detail = config.get('FEATURE');
  //...
}

Tests

$ npm test

Inspiration