Socket
Socket
Sign inDemoInstall

cnf

Package Overview
Dependencies
7
Maintainers
9
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
415
decreased by-1.66%
Maintainers
9
Install size
123 kB
Created
Weekly downloads
 

Readme

Source

cnf npm version Build Status Dependency Status devDependency Status

Configuration loader.

npm install -SE 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 /config/$APP_ENV.js in the current working directory and will be extended with config from global.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 26 Sep 2019

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