1.0.0-alpha.1 • Published 7 years ago

confit-merger v1.0.0-alpha.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

confit-merger

A utility module to merge environment-aware confit based configurations.

Please read these documents on confit:

Usage

    const ConfitMerger = require('confit-merger');

    ConfitMerger( {
        paths: [
            Path.resolve('path/to/default/config'),
            Path.resolve('path/to/module/config'),
            Path.resolve('path/to/app/config')
        ]
    }).then(config => {

        // `config` is the Merged confit object.
        console.log(config.get('a'));
    });

API

ConfitMerger(options)

  • options - (Object) - (required) - Options for confit merger

    • paths - (*Array) - (required) - The list of absolute paths of the basedir of the config files (basedir is the directory in which confg files can be located).

    • protocols - (*Object) - (optional) - An object containing the details of shortstop protocols to be added in addition to the default shortstop-handlers.

Example