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

@iqx-limited/web-errors

v1.1.0

Published

Shared error codes, response shape and header names for iqxWEB and iqxWebHub

Readme

@iqx-limited/web-errors

The shared error contract between iqxWebHub, the iqxWEBv2 server and the iqxWEBv2 client:

  • the error-code table (AUTH-SSO-004 → HTTP status + public message),
  • the AppError class both servers throw,
  • the response body shape and header names,
  • parseErrorResponse ( ) so every client reads errors the same way, and
  • the request-reference format shown to users next to the code.

Nothing in this package is secret — it is bundled into the browser. What a code means internally and what to check when it is reported lives on the IQX wiki page "Web error codes", keyed by code.

Install

npm i @iqx-limited/web-errors

ESM first (all three consumers are ESM), with a CommonJS build under dist/cjs for tooling that resolves require — Jest in the iqxWEB client needs it. Node ≥ 20.

Server usage (Fastify)

import { AppError, ERROR_CODE_HEADER, REQUEST_ID_HEADER } from "@iqx-limited/web-errors"

// Where the cause is known:
throw new AppError ( "AUTH-SSO-004", {
  detail: upstream.error_description,   // sanitised; only sent on debug-enabled requests
  cause: err,                            // for logs / Sentry, never sent
  attributes: { provider: "google" }     // for the log line, never sent
} )

// In the error handler:
const e = AppError.isAppError ( error ) ? error : new AppError ( "SYS-500", { cause: error } )
reply
  .code ( e.status )
  .header ( REQUEST_ID_HEADER, req.id )
  .header ( ERROR_CODE_HEADER, e.code )
  .send ( e.toBody ( req.id, req.debugEnabled ) )

Client usage

import { parseErrorResponse, formatErrorReference } from "@iqx-limited/web-errors"

const parsed = parseErrorResponse ( res.status, res.headers, res.error )
toastr.error ( parsed.message, undefined, { subtitle: formatErrorReference ( parsed ) } )
// → "We could not complete sign-in with the provider. Please try again."
//   "AUTH-SSO-004 · ref 7F3K2QX9BD"

parseErrorResponse never throws and understands the legacy bodies too (plain strings, { IQXFailure }, { IQXResult.IQXFailure.attrs.message }), falling back to the headers and then to a status-derived SYS-* code, so it can be adopted on the client before the servers are converted.

Response contract

Every error response carries the headers x-request-id and x-iqx-error-code. Once a server is on this package its body is:

{ "error": { "code": "AUTH-SSO-004", "message": "…", "ref": "7F3K2QX9BD", "detail": "…" } }

detail is only present on debug-enabled requests (server LOG_LEVEL=debug or the user listed in DEBUG_USERS). Such responses also carry x-iqx-debug: 1.

Adding a code

  1. Add it to src/codes.ts under its area. Never renumber or reuse a code; mark retired ones deprecated: true.
  2. Add the internal meaning and what-to-check to the wiki page.
  3. npm test (format, status range, message hygiene, deliberate-sharing list).
  4. Bump version in package.json, commit, tag vX.Y.Z, push the tag — the publish workflow does the rest.

Development

npm ci
npm test
npm run build

Publishing needs the NPM_TOKEN repository secret (the @iqx-limited scoped token).