node package manager



Jus-Config is a Node.JS module that will help you manager your configuration files, supporting multiple formats, and ability to load and merge multiple files over multiple directories.

Quick example

Suppose you want to make your app's port configurable. You'll have these two configuration files:

// "config/default.json" 
// This is the default options 
{ "host": "localhost"
, "port": 3000 }
// "config/prod.json" 
// This is, for example, your unversionned env-specific configuration 
{ "port": 80 }

Then you can load your configuration files this way:

var conf = require('jus-config')
  , express = require('express')
  , app = express.createServer()
// Load configuration from "config/default.json" and/or "config/prod.json" 
conf.load(['default', 'prod'], function(err, config) {
  // config = { "host": "localhost", "port": 80 } 

Download and install

From npm

npm install jus-config

or add "jus-config" as a dependency in your package.json and call npm install.

From git

git clone the repository in node_modules/jus-config. You're ready to go.


Loading configuration

  • load - load configuration

Configure parsers

Debug mode

  • debug - enables/disables debug