attempt-promise
Promise wrapper for attempt
Last updated 4 years ago by martinj .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install attempt-promise 
SYNC missed versions from official npm registry.

Build Status

attempt-promise

A wrapper that returns promises for attempt

Installation

$ npm install attempt-promise

Examples

Using node style callback function

attempt({retries: 2}, function (cb) {
	cb(null, 'ok');
}).then(function (result) {
	console.log('Yes!', result);
});

Using a function that returns a promise

attempt(function () {
	return Promise.resolve('ok');
}).then(function (result) {
	console.log('Yes!', result);
});

Current Tags

  • 2.0.1                                ...           latest (4 years ago)

3 Versions

  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 1
Last Month 1
Dependencies (2)
Dev Dependencies (5)

Copyright 2014 - 2016 © taobao.org |