src/config.js
function load(fromPath, relativePaths, opts) {
    opts = opts || {};
    var ignores = opts.ignores || [];
    if (typeof ignores === 'string') ignores = [ignores];

    var conf = {};
    relativePaths.forEach(function(relativePath) {
        var path = Path.resolve(fromPath, relativePath);
        var config = loadFile(path, ignores);
        extend(conf, config);
    });

    if (conf.get === undefined) {
        bindGetMethod(conf);
    } else {
        throw new Error('`get` property cannot be the root key of config');
    }

    return conf;
}
function load(fromPath, relativePaths, opts) {
    opts = opts || {};
    var ignores = opts.ignores || [];
    if (typeof ignores === 'string') ignores = [ignores];

    var conf = {};
    relativePaths.forEach(function(relativePath) {
        var path = Path.resolve(fromPath, relativePath);
        var config = loadFile(path, ignores);
        extend(conf, config);
    });

    if (conf.get === undefined) {
        bindGetMethod(conf);
    } else {
        throw new Error('`get` property cannot be the root key of config');
    }

    return conf;
}
function load ( fromPath , relativePaths , opts ) { opts = opts || { } ; var ignores = opts . ignores || [ ] ; if ( typeof ignores === 'string' ) ignores = [ ignores ] ; var conf = { } ; relativePaths . forEach ( function ( relativePath ) { var path = Path . resolve ( fromPath , relativePath ) ; var config = loadFile ( path , ignores ) ; extend ( conf , config ) ; } ) ; if ( conf . get === undefined ) { bindGetMethod ( conf ) ; } else { throw new Error ( '`get` property cannot be the root key of config' ) ; } return conf ; }
Load your config files.

You could invoke the `load` function many times. Each returned config is independent and not affected by each other.

@example
// Assume that there are two files 'test/config/default.js', 'test/config/local.js',
// and the codes in 'test/config/index.js':
load(__dirname, ['default.js', 'local.js']);

@param  {String} fromPath  A absolute path to sub-config folder.
@param  {String[]} relativePaths  The paths of config files, which relative to `fromPath`.
The latter item will overwrite the former recursively.
@param  {Object} [opts]
@param  {String|String[]} [opts.ignores] Filenames that allowed missing when loading these files.
@return {Object}  The final config object.
@throws Throw an error if the files of relativePaths are missing.
You could set `CONFIG_SP_LOAD_FILE_MISSING` environment variable for toleration
@method load
Load your config files .