Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

attempt-promise

2.0.1 • Public • Published

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

Install

npm i attempt-promise

DownloadsWeekly Downloads

62

Version

2.0.1

License

MIT

Last publish

Collaborators

  • avatar