function DB(name, options){
    EventEmitter.call(this, {
        maxListeners: 30,
        wildcard: true,
        newListener: true,
        delimiter: ':'
    });
    options = options || {};
    this.defaults = {
        path: path.join(app.path, 'stores'),
        type: 'file',
        name: name,
        ext: '.db',
        onLoaded: function(){}
    };
    this.options = _.extend({}, this.defaults, options);
    this._dbPath = path.resolve(this.options.path, this.options.name + this.options.ext);
    this._db = new Datastore(this._dbPath);
    this._models = {};
    this._db.loadDatabase(this.options.onLoaded);
}
/**
 * Database object. Creates and manages database files, models etc.
 *
 * @class
 * @param {string} name - The name of the database (and file)
 * @param {object} [options] - Database options
 * @constructor
 * @example
 * var db = new require('radic').DB('myfileDB4', {
 *     path: 'HOMEDIR/.radic/stores',
 *     ext: '.db',
 *     onLoaded: function(){}
 * });;
 *
 */
Database object. Creates and manages database files, models etc.
Database object . Creates and manages database files models etc .
function DB(name, options){
    EventEmitter.call(this, {
        maxListeners: 30,
        wildcard: true,
        newListener: true,
        delimiter: ':'
    });
    options = options || {};
    this.defaults = {
        path: path.join(app.path, 'stores'),
        type: 'file',
        name: name,
        ext: '.db',
        onLoaded: function(){}
    };
    this.options = _.extend({}, this.defaults, options);
    this._dbPath = path.resolve(this.options.path, this.options.name + this.options.ext);
    this._db = new Datastore(this._dbPath);
    this._models = {};
    this._db.loadDatabase(this.options.onLoaded);
}
function DB ( name , options ) { EventEmitter . call ( this , { maxListeners : 30 , wildcard : true , newListener : true , delimiter : ':' } ) ; options = options || { } ; this . defaults = { path : path . join ( app . path , 'stores' ) , type : 'file' , name : name , ext : '.db' , onLoaded : function ( ) { } } ; this . options = _ . extend ( { } , this . defaults , options ) ; this . _dbPath = path . resolve ( this . options . path , this . options . name + this . options . ext ) ; this . _db = new Datastore ( this . _dbPath ) ; this . _models = { } ; this . _db . loadDatabase ( this . options . onLoaded ) ; }
Database object.
Database object .