ee-config

get & set config values using a mysql db

npm install ee-config
4 downloads in the last month

ee-config

gets & sets config values from a mysql db. depeds on a config file ( config.js in the project root )

var config = require( "ee-config" ) , log = require( "ee-log" );

config.get( "env", function( value ){
  log.dir( value );
} );


config.on( "load", function(){
  log.dir( config.get( "env" ) );
} );



config.set( "test", Math.random() );

config.get( "test", function( value ){
  log.dir( value );
} );

config file:

module.exports = {
      database:         "dbName"
    , hosts: [
        {
              host:     "1dbHsot"
            , user:     "dbUser"
            , password: "dbPass"
            , weight:   "optional int ( used for load balancing )"
            , writable: true
        }
    ]
};
npm loves you