@prismamedia/retry
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

TS Retry

About

This module aims to ease the retry of a function, using an exponential time between tries.

Getting started

Usage

import { retry } from '@prismamedia/retry';

try {
  const myResult = await retry(async () => {
    // Do my processing that may throw an Error

    return 2;
  });
} catch (err) {
  // Handle error after "n" tries
}

Readme

Keywords

none

Package Sidebar

Install

npm i @prismamedia/retry

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

825 kB

Total Files

28

Last publish

Collaborators

  • prismamedia
  • yvann