0.1.5 • Published 7 years ago

app-config-loader v0.1.5

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
7 years ago

node-config-loader

This package is used for loading configs for applications. It handles multiple environments as well.

Installation

npm install app-config-loader

Get started

Our test config file looks like this:

module.exports = {
    common: {
        common: {
            globalVar: 'common',
            globalCommonToOverwrite: 'common'
        },
        staging: {
            globalVarStaging: 'common-staging',
            globalStagingToOverwrite: 'common-staging',
            globalCommonToOverwrite: 'common-staging'
        }
    },
    testapp: {
        common: {
            appVar: 'app',
            globalCommonToOverwrite: 'app'
        },
        staging: {
            stagingVar: 'app-staging',
            globalStagingToOverwrite: 'app-staging'
        }
    }
};

And we can load it like this:

var ConfigLoader = require('app-config-loader');
var config = ConfigLoader.loadConfig(configFile, 'testapp', 'staging');
0.1.5

7 years ago

0.1.4

8 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago