🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

retry-utils

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retry-utils

retry-utils is a lightweight and intuitive module that provides a simple yet powerful retry mechanism for your applications.

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

retry-utils

retry-utils is a lightweight and intuitive module that provides a simple yet powerful retry mechanism for your applications.

retry()

Retry any async function until it returns a meaningful value or the number of attempts is exhausted

delay()

Delay execution flow for sometime in milliseconds

Usage

import { retry, delay } from "retry-utils";

// Delay execution flow for 5 seconds
await delay(5000);

// Retries function at least 10 times with 3 seconds interval until it returns a value
await retry(
    () => true;
    {
        attempts: 10, // default 5
        delayMs: 5000, // default 3000
    })

Keywords

typescript

FAQs

Package last updated on 26 Aug 2023

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