Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saintedlama/remorseless
Retry failed functions
https://github.com/saintedlama/remorseless
Last synced: about 15 hours ago
JSON representation
Retry failed functions
- Host: GitHub
- URL: https://github.com/saintedlama/remorseless
- Owner: saintedlama
- Created: 2016-07-22T16:06:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T21:05:55.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T12:25:40.774Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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 });
```