3.0.0 • Published 10 years ago

koars-config v3.0.0

Weekly downloads
1
License
BSD-3-Clause
Repository
github
Last release
10 years ago

koars-config

Build Status

This module provides config loading for the koars framework.

Loading

var config = require('config')('path/to/config/files');

The above code, loads all files within the path/to/config/files directory and requires them. It then assigns each files contents to a shared object and returns it.

Directory contents:

example.js
static.json

Resulting object:

{
	example: require('example.js'),
	static: require('static.json')
}

Defaults

The returned object also has a method named defaults which can be used to set default values for your configuration files.

config.defaults('example', {some: 'data'});

This would assign 'data' to the config.example.some property. This overrides no properties, but simply sets those properties which are not set.

3.0.0

10 years ago

2.1.0

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago