Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

nconfs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nconfs

node.js convention/library for multiple nconf settings.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

(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('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.

Keywords

configuration

FAQs

Package last updated on 13 Sep 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts