bity-promise
Super simple promises with timeout expiration for Node
Installation
npm install bity-promise
The constructor takes three arguments, but only the success callback is required:
new Promise(successCallback, failCallbackOptional, timoutMSOptional)
Three methods are available, make(name)
, break(name)
, and resolve(name)
.
Simple Usage
var promise = require("bity-promise");
var p = new promise(function() {
console.log("success!");
}, function() {
console.log("some promises broken");
}, 10000);
p.make("promiseA");
p.make("promiseB");
p.make(["promiseC", "promiseD"]);
p.break("promiseA");
p.resolve("promiseB");