app-config-loader

0.1.5 • Public • Published

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');

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.50latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00

Package Sidebar

Install

npm i app-config-loader

Weekly Downloads

0

Version

0.1.5

License

Apache-2.0

Last publish

Collaborators

  • filc