Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

pend

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

pend

dead-simple optimistic async helper

    1.2.0latest

Version published
Maintainers
1
Weekly downloads
11,456,753
decreased by-2.18%

Weekly downloads

Readme

Source

Pend

Dead-simple optimistic async helper.

Usage

var Pend = require('pend'); var pend = new Pend(); pend.max = 10; // defaults to Infinity setTimeout(pend.hold(), 1000); // pend.wait will have to wait for this hold to finish pend.go(function(cb) { console.log("this function is immediately executed"); setTimeout(function() { console.log("calling cb 1"); cb(); }, 500); }); pend.go(function(cb) { console.log("this function is also immediately executed"); setTimeout(function() { console.log("calling cb 2"); cb(); }, 1000); }); pend.wait(function(err) { console.log("this is excuted when the first 2 have returned."); console.log("err is a possible error in the standard callback style."); });

Output:

this function is immediately executed this function is also immediately executed calling cb 1 calling cb 2 this is excuted when the first 2 have returned. err is a possible error in the standard callback style.

FAQs

What is pend?

dead-simple optimistic async helper

Is pend popular?

The npm package pend receives a total of 9,651,158 weekly downloads. As such, pend popularity was classified as popular.

Is pend well maintained?

We found that pend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 23 Nov 2014
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc