Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cnf

Package Overview
Dependencies
Maintainers
9
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cnf

Configuration loader

  • 3.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
248
decreased by-32.24%
Maintainers
9
Weekly downloads
 
Created
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

Package last updated on 26 Sep 2019

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc