Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

forEachAsync

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forEachAsync

The forEachAsync module of FuturesJS (Ender.JS and Node.JS)

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-62.23%
Maintainers
1
Weekly downloads
 
Created
Source

Array.forEachAsync()

Another reincarnation of sequence that makes sense for the use case of arrays.

Example:

var forEachAsync = require('forEachAsync')
  , count = 0
  , timers = [
      101,
      502,
      203,
      604,
      105
    ];

function hello(next, time) {
  this[count] = time;

  if (count >= 4) {
    next(forEachAsync.BREAK);
  }

  console.log(count += 1, time);

  setTimeout(next, time);
}

function goodbye() {
  console.log("All Done", this);
}

forEachAsync(timers, hello, {}).then(goodbye);

API

  • forEachAsync(array, callback*[, thisArg]*)
  • forEachAsync#then(finalCallback)
  • forEachAsync#BREAK

Warning: Poorly written code may have really strange errors when Array.prototype is extended. If you run into such problems please contact the author of the code (I'm also willing to help if they are unavailable). Libraries such as jQuery or MooTools will accept bug reports for such failures.

Keywords

FAQs

Package last updated on 03 Jul 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc