Skip to content
forked from tofumatt/nconfs

A node.js convention/library for supporting multiple nconf settings with inheritance

Notifications You must be signed in to change notification settings

gwhitelaw/nconfs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(n)confs

A node.js convention/library for supporting multiple nconf settings with inheritance.

|- app.js
|- defaults.json
|- local.js-dist

Structure your app like this and defaults.json is loaded, then defaults-$NODE_ENV.json, then local.json if it exists. If none of these files exist: your app is still loaded.

Installation

npm install nconfs

Usage

var conf = require('nconfs').load()

// Load extra confs:
var conf = require('nconfs').load(null, 'extras.json')

Works like nconf otherwise:

'use strict';

var express = require('express')
var conf = require('nconfs').load()

var app = express.createServer()

app.get('/', function(req, res) {
    res.send('Hello World')
});

app.listen(conf.get('port'))

Yup.

Thanks to @zalun for inspiring me to write/lazily abstract this from newnewtab.

About

A node.js convention/library for supporting multiple nconf settings with inheritance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%