Skip to content

revington/backoff-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Known Vulnerabilities Coverage Status

backoff-time

Zero deps backoff time function

Install

$ npm install backoff-time

Usage

const minBackoff = 50;
const maxBackoff = 5000;
const backoff = require('backoff-time')(minBackoff, maxBackoff);
var attempt = 0;

function blah(...){
}
// every time blah fails we increment *attempt*
const wait = backoff(attempt);
// retry
setTimeout(fn, wait);

About

Zero deps backoff time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages