0.1.4 • Published 7 years ago

config-man v0.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
7 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

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago