lib/db.js
function load(filename) {

  return function(cb) {
    var file = path.join(process.cwd(), filename)
      , json = require(file)
      , model = exports[json.table]
      , rows = json.rows;

    console.log('Loading', file);

    run();
    function run() {
      var row = rows.shift();
      if(row !== undefined) {
        model.create(row, function(err) {
          if(err) {
            cb(err);
          } else {
            run();
          }
        });
      } else {
        cb();
      }
    }
  };
}
function load(filename) {

  return function(cb) {
    var file = path.join(process.cwd(), filename)
      , json = require(file)
      , model = exports[json.table]
      , rows = json.rows;

    console.log('Loading', file);

    run();
    function run() {
      var row = rows.shift();
      if(row !== undefined) {
        model.create(row, function(err) {
          if(err) {
            cb(err);
          } else {
            run();
          }
        });
      } else {
        cb();
      }
    }
  };
}
function load ( filename ) { return function ( cb ) { var file = path . join ( process . cwd ( ) , filename ) , json = require ( file ) , model = exports [ json . table ] , rows = json . rows ; console . log ( 'Loading' , file ) ; run ( ) ; function run ( ) { var row = rows . shift ( ) ; if ( row !== undefined ) { model . create ( row , function ( err ) { if ( err ) { cb ( err ) ; } else { run ( ) ; } } ) ; } else { cb ( ) ; } } } ; }
Loads `filename` in the database

@param {String} filename
Loads filename in the database