Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

appconf

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appconf

Application Environment Configure

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

appConf

Application Environment Configure

Why : To Read any environment specific configuration from the application.

Features : If you have not set the environment, by default "development" specific configurations will be loaded into the memory. Set the environment using NODE_ENV for specific environments like qa, production etc.

    These are the environments supported:
    development,
    test,
    staging,
    qa,
    production

How To Configure:

Add the directory path and file information in application package.json

"appConf": {
        "directories": "config", // directory name which has all the configuration files
        "files": [
            "app"  // array of files
        ]
    }

How To Use:

var appConf = require('appconf').loadConf();

How get value appConf

console.log(appConf.get('port'), "->port");
//3000 ->port

How set value appConf

appConf.set("host", "localhost");
console.log(appConf.get("host"), "->host");
//localhost ->host

Keywords

node.js

FAQs

Package last updated on 09 Jul 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