Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/saintedlama/remorseless

Retry failed functions
https://github.com/saintedlama/remorseless

Last synced: about 15 hours ago
JSON representation

Retry failed functions

Awesome Lists containing this project

README

        

# remorseless

Retry failed functions

## Usage

npm install remoreseless --save

```js
var remorseless = require('remorseless');

function fn(next) {
// Do something
return next(err);
}

// Wrap fn to be retryable
var retryable = remorseless(fn);

retryable(function(err) {
// Will be called with original error object if fn fails more than 3 times
});

// Set retry count to 5
var retryable5Times = remorseless(fn, 5);

// Use options object
var retryable5Times = remorseless(fn, { times: 5 });
```