Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

config file finder for nconf w/ defaults and overrides

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 example
Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 package.json
README.md

About

Reconf is used in order to find a configuration file in a similar manner to how npm finds a package.json. It will recurse up the directory tree until it finds a matching file. Also, it will try the user's home directory should that not succeed.

Since command line arguments and other inputs may be important to override configuration and defaults should be provided for many values, reconf will take care of these for you. You may supply arguments to nconf to set up overriding values and defaults. If you do not supply arguments defaults will be empty and overrides will correspond to optimist's argv.

Usage

var overrides = require('optimist').argv;
var defaults = {'angry':false};
var config = require('reconf')('.myconf',overrides,defaults)
config.load()
//
// Show the current value of the 'angry' setting
//
console.log(config.get('angry'))
Something went wrong with that request. Please try again.