node package manager

ycb

YCB is a multi-dimensional configuration library that builds bundles from resource files describing a variety of values.

Yahoo! Configuration Bundle

YCB is a multi-dimensional configuration library that builds bundles from resource files describing a variety of values. The library allows applications to configure themselves based on multiple dimensions describing locations, languages, environments, etc.

npm install ycb --save

var YCB = require('ycb');
var configArray = [
    {
        "dimensions": [
            {
                "environment": {
                    "dev": null,
                    "prod": null
                }
            }
        ]
    },
    {
        "settings": ["master"],
        "host": "example.com"
    },
    {
        "settings": ["environment:dev"],
        "host": "dev.example.com"
    }
];
 
var ycbObj = new YCB.Ycb(configArray);
var computedConfig = ycbObj.read({ environment: 'dev' });
 
console.log(computedConfig.host); // dev.example.com

Examples are provided in the tests directory.

BSD see LICENSE.txt