Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bity-promise

alexei.white9MIT0.0.6

Yet another simple promise system for Node - but with timeouts

node, promise, async, timeout

readme

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