Attributes
Includes Deno configuration
Repository
Current version released
3 months ago
Versions
retry
A tiny utility for exponentially retrying
This is free to use software, but if you do like it, consider supporting me ❤️
⚙️ Install
npm add rtri
npx jsr add @mr/retry
🚀 Usage
import { retry } from 'rtri';
// or
import { retry } from 'https://deno.land/x/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