0.0.1 • Published 6 months ago

rtri v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

rtri

A tiny utility for exponentially retryin

This is free to use software, but if you do like it, consisder supporting me ❤️

sponsor me buy me a coffee

⚙️ Install

npm add rtri

🚀 Usage

import { retry } from 'rtri';

const get_data = await retry(
  async () => {
    const response = await fetch('https://example.com');
    if (!response.ok) throw new Error('not ok');
    return response.json();
  },
  { attempts: 3 },
);

await get_data();

License

MIT © Marais Rossouw

0.0.1

6 months ago

0.0.0

6 months ago