🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@sebspark/retry

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sebspark/retry

A helper for retrying any promise call (ex an http request) with error rules and backoff

Source
npmnpm
Version
1.0.12
Version published
Weekly downloads
1.3K
43.17%
Maintainers
3
Weekly downloads
 
Created
Source

@sebspark/retry

A helper for retrying any promise call (ex an http request) with error rules and backoff

Usage

import { retry, interval, retryCondition, RetrySettings } from '@sebspark/retry'
import axios from 'axios'

const settings: RetrySettings = {
  interval: interval.exponential(1000), // Exponential backoff starting at 1000 ms
  maxRetries: 5,
  retryCondition: retryCondition.serverErrors, // Only retries on server errors
}

const result = await retry(() => axios.get('https://example.com'), settings)

FAQs

Package last updated on 04 May 2026

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