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

@vouchington/queue-errors

v0.1.1

Published

glide-mq retry classification and worker rate-limit helpers.

Readme

@vouchington/queue-errors

General-purpose error classification helpers for glide-mq workers. This package owns queue mechanics only: applications supply provider-specific status extraction, rate-limit detection, and cooldown policy.

Install

pnpm add @vouchington/queue-errors glide-mq

GlideMQ is a peer dependency so workers and these helpers share the same control-flow error classes.

HTTP retry classification

wrapHttpForRetry makes ordinary HTTP 4xx errors terminal by throwing GlideMQ's UnrecoverableError. It rethrows timeouts (408), rate limits (429), 5xx, and failures with no recognized status so GlideMQ can apply its configured retry policy.

import { wrapHttpForRetry } from '@vouchington/queue-errors'

await callProvider().catch(wrapHttpForRetry)

Use getStatus for provider-specific error shapes and isRetryableStatus to choose which client responses are transient. Supplying isRetryableStatus replaces the default 408/429/5xx policy for every recognized 400–599 status, so the callback must return true for each status that your application considers transient. unrecoverable(error, message?, options?) explicitly marks any failure terminal.

Applications that resolve a different glide-mq copy than this package can pass UnrecoverableError and RateLimitError constructors so thrown errors match the application’s instanceof checks. Defaults remain this package’s glide-mq classes. The injected terminal constructor must accept a required message: string parameter, matching glide-mq's own UnrecoverableError; the injected rate-limit constructor takes no arguments.

import { UnrecoverableError, Worker } from 'glide-mq'
import { handleRateLimitedError, unrecoverable, wrapHttpForRetry } from '@vouchington/queue-errors'

unrecoverable(error, 'terminal', { UnrecoverableError })
wrapHttpForRetry(error, { UnrecoverableError, getStatus })
await handleRateLimitedError(error, worker, {
  cooldownMs,
  isRateLimited,
  UnrecoverableError,
  RateLimitError: Worker.RateLimitError,
})

Provider rate limits

When a provider returns a rate limit, pause the worker for the application-selected cooldown and throw GlideMQ's control-flow error so the current job is scheduled after the cooldown. GlideMQ's normal retry accounting applies, so applications should configure attempts accordingly.

import { handleRateLimitedError } from '@vouchington/queue-errors'

try {
  await callProvider()
} catch (error) {
  await handleRateLimitedError(error, worker, {
    cooldownMs: retryAfterMs,
    isRateLimited: (value) => getProviderStatus(value) === 429,
  })
}

cooldownMs must be a positive safe integer. The package does not choose provider names, identifiers, throttling rules, or fallback policy. Provider exception names, SDK-specific metadata extraction, and fixed cooldowns belong in an application adapter.