npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reely/async

v0.0.7

Published

Async utility functions with retry logic and error handling for TypeScript applications.

Readme

@reely/async

Async utility functions with retry logic and error handling for TypeScript applications.

📦 Package Information

  • Version: 0.0.1
  • Publishable: ✅ Yes
  • Tag: scope:async
  • Module Boundaries: Can only import from scope:shared packages

⚠️ CI Demo Note

This package includes an intentionally failing test to demonstrate Nx's self-healing CI feature. When you run tests, you'll see one failure. This is by design to showcase how nx fix-ci works in the CI pipeline.

🚀 Features

This package provides powerful async utilities:

  • retry - Retry failed async operations with configurable options
  • createRetry - Create reusable retry functions with default options
  • withRetry - Wrap functions to automatically retry on failure
  • retryAll - Retry multiple operations and wait for all
  • retryRace - Race multiple operations with retry
  • retryAllSettled - Get all results regardless of success/failure
  • TimeoutError - Custom error class for timeout scenarios

📝 Usage Examples

import { retry, createRetry, withRetry, TimeoutError } from '@reely/async';

// Basic retry with default options
const result = await retry(async () => {
  const response = await fetch('/api/data');
  return response.json();
});

// Retry with custom options
const data = await retry(
  async (attempt) => {
    console.log(`Attempt ${attempt + 1}`);
    return await riskyOperation();
  },
  {
    retries: 3,      // Max 3 retries
    delay: 1000,     // 1 second delay
    backoff: 2       // Exponential backoff factor
  }
);

// Create a reusable retry function
const retryWithDefaults = createRetry({
  retries: 2,
  delay: 500
});

const result1 = await retryWithDefaults(operation1);
const result2 = await retryWithDefaults(operation2);

// Wrap a function to automatically retry
const safeFunction = withRetry(riskyFunction, { retries: 3 });
const result = await safeFunction(arg1, arg2);

// Retry multiple operations
const results = await retryAll([
  operation1,
  operation2,
  operation3
], { retries: 2 });

// Race operations with retry
const fastest = await retryRace([
  slowOperation,
  fastOperation
]);

🧪 Testing

# Run tests for this package (includes 1 intentional failure for CI demo)
nx test async

# Run tests in watch mode
nx test async --watch

# Run specific test file
nx test async --testFile=async-retry.spec.ts

🏗️ Building

# Build the package
nx build async

# The build output will be in dist/packages/async

📋 Available Commands

nx build async    # Build the package
nx test async     # Run tests (includes intentional failure)
nx lint async     # Lint the package

🔒 Module Boundaries

This package has the tag scope:async and can only import from:

  • @reely/utils (tagged with scope:shared)

Attempting to import from @reely/colors or @reely/strings will result in a linting error due to module boundary constraints.

🔧 Self-Healing CI Demo

This package demonstrates Nx's self-healing CI capabilities. The intentionally failing test helps showcase:

  1. How CI detects failures
  2. How nx fix-ci provides automated suggestions
  3. How the system can self-correct common issues

To see this in action in CI, the workflow runs:

npx nx fix-ci

This command analyzes failures and provides actionable fixes.