polly-js
Transient exception handling for JavaScript made easy.

Polly-js is a library to help developers recover from transient errors using policies like retry or wait and retry.

Usage
Try to load the Google home page and retry twice if it fails
polly
.retry(2)
.executeForPromise(function () {
return requestPromise('http://www.google.com');
})
.then(function(result) {
console.log(result)
}, function(err) {
console.error('Failed trying three times', err)
});
polly
.retry(2)
.executeForNode(function (cb) {
fs.readFile(path.join(__dirname, './hello.txt'), cb);
}, function (err, data) {
if (err) {
console.error('Failed trying three times', err)
} else {
console.log(data)
}
});
Acknowledgements
The library is based on the Polly NuGet package by Michael Wolfenden