Socket
Socket
Sign inDemoInstall

@sebspark/retry

Package Overview
Dependencies
0
Maintainers
4
Versions
1
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
626
decreased by-43.25%
Maintainers
4
Install size
19.9 kB
Created
Weekly downloads
 

Readme

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

Last updated on 22 Nov 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc