0.1.4 • Published 9 years ago

config-man v0.1.4

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

config-man

Configuration manager for NodeJS apps (Browser app support underway)

Installation

npm install --save config-man

Usage

You need to have a config-man.json file in your project root. This file defines the schema of your config.

Example config-man.json:

{
    "schema": [
        {"key": "environment", "type": "string", "allowed": ["dev", "prod"]},
        {"key": "log.level", "type": "string", "allowed": ["debug", "info", "warning", "error"], "default": "info"}
    ]
}

Start configMan:

const configMan = require('config-man');
configMan.init([options])
    .then(startApp);

function startApp() {
    if (configMan.get('log.level') === 'debug') {
        console.debug('App started');
    }
}

ConfigMan can also be started syncronously, but no asyncronous config types will be available.

configMan.initSync([options]);
startApp();
0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago