1.0.1 • Published 8 years ago

confload v1.0.1

Weekly downloads
8
License
-
Repository
github
Last release
8 years ago

config

A simple configuration loader for Node.js

Build Status

Installation

npm install confload

Usage

config.json

{
    "some-module": {
        "example": true
    }
}

index.js

'use strict';
const config = require('confload').loadFromFile(__dirname + '/config.json');
const someModule = require(__dirname + '/lib/some-module');

lib/some-module.js

'use strict';
const config = require('confload');

config.get() // {"some-module": {"example": true}}
config.get('some-module') // {"example": true}
config.get('some-module', 'example') // true