From the documentation at http://nodejs.org/api/fs.html#fs_fs_stat_path_callback
fs.stat (path, callback)
Asynchronous stat (2). The callback receives two arguments (err, stats), where stats is the fs.Stats object. See the fs.Stats section below for more information.
Since fs.stat callback returns (err, stats), the following works fine
async.map(['file1','file2','file3'], fs.stat, function(err, results){
To do the same, pass a function that with the appropriate callback
var async = require('async') var inspect = require('eyespect').inspector(); function custom(param, callback) { var result = 'foo result' var err = null callback(err, result) } var items = ['item1', 'item2'] async.map(items, custom, function (err, results) { inspect(results, 'results') })
source share