util/async.js
function(items, iterator, done) {
    done = done || function() {};
    var results = [];
    var failure = false;
    var expected = items.length;
    var current = -1;

    function callback(err, result) {
      if (err) return done(err);

      results.push(result);

      if (current == expected) {
        return done(null, results);
      } else {
        next();
      }
    }

    function next() {
      current += 1;

      var item = items[current];
      iterator(item, callback);
    }

    next()
  }
function(items, iterator, done) {
    done = done || function() {};
    var results = [];
    var failure = false;
    var expected = items.length;
    var current = -1;

    function callback(err, result) {
      if (err) return done(err);

      results.push(result);

      if (current == expected) {
        return done(null, results);
      } else {
        next();
      }
    }

    function next() {
      current += 1;

      var item = items[current];
      iterator(item, callback);
    }

    next()
  }
function ( items , iterator , done ) { done = done || function ( ) { } ; var results = [ ] ; var failure = false ; var expected = items . length ; var current = - 1 ; function callback ( err , result ) { if ( err ) return done ( err ) ; results . push ( result ) ; if ( current == expected ) { return done ( null , results ) ; } else { next ( ) ; } } function next ( ) { current += 1 ; var item = items [ current ] ; iterator ( item , callback ) ; } next ( ) }
Works like async.eachSeries
Works like async . eachSeries