New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

confe

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

confe

Simple config file management.

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

confe

Simple config file management.

Top level keys that include the special "extends" key will include, and overwrite, keys from that top level key. This process is recursive.

The two required arguments can be set via the enviroment variables;

  • NODE_CONFIG_FILE
  • NODE_ENV

or provided inline (in order);

  • path to config file
  • top level key name

Installation

$ npm install -g confe

Examples

The following examples show you how to use confe.

var confe = require('confe');

// example config file (config.json)
/*
{
	"dev": {"email": "dev-webmaster@test.com", "google-key": "abcxyz"}
	, "local-developer1": {"extends": "dev", "email": "tom1@test.com"}
	, "local-developer2": {"extends": "dev", "email": "kay2@test.com", "google-key": "123"}
	
	, "prod": {"email": "webmaster@test.com", "google-key": "asdf4567"}
}
*/

var config = confe('./config.json', 'dev');
// { email: 'dev-webmaster@test.com', 'google-key': 'abcxyz' }

// or

var config = confe('./config.json', 'local-developer1');
// { email: 'tom1@test.com', 'google-key': 'abcxyz', extends: 'dev' }

// or

var config = confe('./config.json', 'local-developer2');
// { email: 'kay2@test.com', 'google-key': '123', extends: 'dev' }

// or
// NODE_CONFIG_FILE=/path/to/config.json
// NODE_ENV=prod

var config = confe();
// { email: 'webmaster@test.com', 'google-key': 'asdf4567' }

Running tests

$ npm test

Keywords

FAQs

Package last updated on 24 Jun 2014

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