Socket
Socket
Sign inDemoInstall

cnf

Package Overview
Dependencies
2
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cnf

Configuration loader


Version published
Weekly downloads
299
decreased by-9.67%
Maintainers
6
Install size
46.8 kB
Created
Weekly downloads
 

Readme

Source

cnf npm version Build Status Dependency Status devDependency Status

Configuration loader.

npm install cnf

To use it simply require it:

var config = require('cnf');

console.log('port: ' + config.http.port);

It will look for a configuration file called $APP_ENV.app.config.js in the current working directory and will be extended with config from global.app.config.js.

To override configs use a command line argument prefixed with app.

node example.js --app.http.port 8080

The above line override http.port with 8080

To refer to another part of the config use

{
	port: 8080,
	siteUrl: "http://localhost:$(port)" //this will be "http://localhost:8080"
}

Add a regexp using

--app.mySetting "$regexp(/myRegExp/gmi)"

Keywords

FAQs

Last updated on 30 Mar 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc