🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

config-env

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

config-env

Various config determined by process.env

0.1.0
latest
Source
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

config-env.js

config-env is for switching various configurations by environment variable.

SYNOPSIS

Simple version

var config = require('config-env').define('FOO_ENV', function (config) {
		config.common({
			name: 'test'
		});

		config.config('production', {
			foo : 'prod'
		});

		config.config('development', {
			foo : 'dev'
		});
});

config.param('name');
config.param('foo');

Complex version

// foo-config.js: config definition file
var config = require('config-env').define('FOO_ENV', this);

config.common({
	name: 'test'
});

config.config('production', {
	foo : 'prod'
});

config.config('development', {
	foo : 'dev'
});

// app.js: config use file
var config = require('foo-config');

config.param('name');
config.param('foo');

Keywords

config

FAQs

Package last updated on 14 Aug 2012

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