lib/druid.js
function asyncMap(array, iterator, done) {
  if (!array || !array.length) {
    return done(null, [])
  }

  var error
    , out = []
    , todo = array.length

  array.forEach(exec)

  function exec(item) {
    process.nextTick(function tick() {
      iterator(item, add)
    })
  }

  function add(err, data) {
    if (error) {
      return
    }
    else if (err) {
      error = true
      return done(err)
    }

    out.push(data)

    if (--todo === 0) {
      done(null, out)
    }
  }
}
function asyncMap(array, iterator, done) {
  if (!array || !array.length) {
    return done(null, [])
  }

  var error
    , out = []
    , todo = array.length

  array.forEach(exec)

  function exec(item) {
    process.nextTick(function tick() {
      iterator(item, add)
    })
  }

  function add(err, data) {
    if (error) {
      return
    }
    else if (err) {
      error = true
      return done(err)
    }

    out.push(data)

    if (--todo === 0) {
      done(null, out)
    }
  }
}
function asyncMap ( array , iterator , done ) { if ( ! array || ! array . length ) { return done ( null , [ ] ) } var error , out = [ ] , todo = array . length array . forEach ( exec ) function exec ( item ) { process . nextTick ( function tick ( ) { iterator ( item , add ) } ) } function add ( err , data ) { if ( error ) { return } else if ( err ) { error = true return done ( err ) } out . push ( data ) if ( -- todo === 0 ) { done ( null , out ) } } }
Works like async.map

@param array
@param iterator
@param done
Works like async . map