Wondering what’s next for npm?Check out our public roadmap! »

    enviro-conf

    0.3.1 • Public • Published

    Environment Configuration

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

    BuildStatus 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

    Install

    npm i enviro-conf

    DownloadsWeekly Downloads

    7

    Version

    0.3.1

    License

    MIT

    Last publish

    Collaborators

    • avatar