Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

@eddieajau/config-factory

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eddieajau/config-factory

A simple wrapper for nconf.

latest
Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

Node.js Config Factory

Build Status

A simple wrapper for nconf providing the ability to load configuration files in a directory.

Installation

$ npm install @eddieajau/config-factory

Example

ConfigFactory is a static factory class that can be used to create a standard nconf object. However, there are two parameters that can be passed to the createConfig function.

  • directory - The directory that contains .js or .json configuration files to load.
  • overrides - An optional path to a file that can override the properties merged from configuration directory.
var ConfigFactory = require('@eddieajau/config-factory');

var config = ConfigFactory.createConfig({
	directory: __dirname + '/etc/',
	overrides:  __dirname + '/etc/locals.js'
});

var setting = config.get('setting');

Configuration files can be either valid .js or .json. After loading, the normal nconf API can be applied.

Code quality and tests

$ npm run lint
$ npm run test

License

MIT

References

Keywords

config

FAQs

Package last updated on 20 Aug 2015

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