🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

backoff-time

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backoff-time

Zero deps backoff time

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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);

FAQs

Package last updated on 24 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts