Socket
Socket
Sign inDemoInstall

cnf

Package Overview
Dependencies
1
Maintainers
2
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
324
decreased by-5.26%
Maintainers
2
Install size
37.0 kB
Created
Weekly downloads
 

Readme

Source

cnf Build 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.

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 13 Feb 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