Skip to content

sonewman/foreach-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foreach-async

Array forEach which handles asynchronous operations in Node and the browser (using Browserify, etc.)

install:

$ npm i foreach-async

Usage:

var forEach = require('foreach-async')

forEach(['a', 'b', 'c'], function (value, index, array) {
  
  // do something async
  something.async(function () {
    // signify done, passing optional result
    this.done(*result*)
  }.bind(this))

}, function (results) {
  // called after all array items have been
  // iterated, all values passed to done
  // are accessible in the 'results' array
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published