remorseless
v1.0.0
Published
Retry failed functions
Downloads
1
Readme
remorseless
retry functionality for failed functions.
Usage
npm install remoreseless --save
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 });