Socket
Book a DemoInstallSign in
Socket

apex-config

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apex-config

Simple configuration management

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

apex-config

Simple configuration management

Usage


var CONFIG = require('apex-config');

// set the base to avoid having to use path.join
CONFIG.BASE = __dirname;

switch (CONFIG.ENV) { // defaults to process.env.NODE_ENV;
	case 'local':
		CONFIG.load('../../path/to/local-env-specific.js');
		break;
	case 'remote':
		CONFIG.load('../../path/to/remote-env-specific.js');
		break;
}

CONFIG.load('../../path/to/non-env-specific.js');

var app = require('express')();

app.listen(CONFIG('http.port'), function (err) {
	console.log('App running in env', CONFIG.ENV, ' on port ', CONFIG('http.port'));
})


Keywords

config

FAQs

Package last updated on 18 Feb 2016

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