caolan/async — pull request #297 by jweather (2013-04-17 23:58:54+00:00)
Title: pass partial results object as second argument to tasks in .series()

Allows .series() to function similarly to .waterfall() by passing partial results to subsequent tasks, but accumulates results instead of replacing them completely at each stage, and works with hashmaps of functions.

Example usage:

> var async = require('async');
undefined
> async.series({
one: function(cb) { cb(null, 1); },
two: function(cb, res) { console.log('partial result', res); cb(null, 2); }
},
function(err, res) { console.log('final result', res); }
);
partial result { one: 1 }
final result { one: 1, two: 2 }
undefined

> async.series([
function(cb) { cb(null, 1); },
function(cb, res) { console.log('partial result', res); cb(null, 2); }
],
function(err, res) { console.log('final result', res); }
);
partial result [ 1 ]
final result [ 1, 2 ]
undefined
>