npm.io
0.0.6 • Published 9 years ago

bity-promise

Licence
MIT
Version
0.0.6
Deps
0
Vulns
0
Weekly
0

bity-promise

Super simple promises with timeout expiration for Node ###Installation   npm version

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");

Keywords