collection of js libraries
README.md

@rlib/async #

Async utilities for TypeScript/JavaScript.

Installation #

bun add @rlib/async

Usage #

import { sleep, retry } from '@rlib/async';

// Sleep for 1 second
await sleep(1000);

// Retry a function up to 3 times
const result = await retry(async () => {
  return await fetchData();
}, { attempts: 3, delay: 1000 });