foreach-async

1.1.1 • Public • Published

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
})
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    3
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i foreach-async

Weekly Downloads

3

Version

1.1.1

License

ISC

Last publish

Collaborators

  • sonewman