Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 379 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 379 Bytes

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
}