ee-config

0.1.1 • Public • Published

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
        }
    ]
};

Readme

Keywords

none

Package Sidebar

Install

npm i ee-config

Weekly Downloads

0

Version

0.1.1

License

none

Last publish

Collaborators

  • ee