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

@dcsv-io/d2-error-category

v0.1.2

Published

<!-- Copyright (c) DCSV. Licensed under the Apache License, Version 2.0. -->

Readme

@dcsv-io/d2-error-category

Foundational zero-dependency leaf that exports the closed ErrorCategory classification — the nine-value semantic/telemetry class every D2Result and every error code carries. Mirrors DcsvIo.D2.ErrorCodes.Category on the .NET side. Lives here so @dcsv-io/d2-result and @dcsv-io/d2-error-codes-registry can import ErrorCategory without risking a circular dependency.

The category is the producer's coarse signal — infrastructure_unavailable, not_found, validation_failure — so a consumer can do generic class-based handling (retry any infrastructure_unavailable) without importing the producer's error-code catalog.

Install

pnpm add @dcsv-io/d2-error-category

Public API

| Export | Purpose | | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ErrorCategory | The nine-value string-union of snake_case wire strings (e.g. "not_found"). The wire string IS the union value. | | ErrorCategoryWire | const object mapping each PascalCase member name → wire string (e.g. ErrorCategoryWire.NotFound === "not_found"). Mirrors the .NET ErrorCategory members. | | ALL_ERROR_CATEGORIES | Readonly array of every wire string in canonical (ordinal) order. |

All three are generated from contracts/error-category/error-category.spec.json (sources committed). Do not edit src/generated/error-category.g.ts by hand — changes are overwritten on the next codegen run.

Dependencies

None. This is a zero-dependency leaf so any package may import it regardless of where it sits in the graph.

Usage example

import { type ErrorCategory, ErrorCategoryWire } from "@dcsv-io/d2-error-category";

function isRetryable(category: ErrorCategory): boolean {
  return (
    category === ErrorCategoryWire.InfrastructureUnavailable ||
    category === ErrorCategoryWire.RateLimited
  );
}

Why a separate package

ErrorCategory is needed by both @dcsv-io/d2-result (the typed D2Result.category field) and @dcsv-io/d2-error-codes-registry (the ErrorCodeInfo.category field). Keeping it in a shallow zero-dep leaf breaks any potential cycle structurally — exactly the precedent set by @dcsv-io/d2-i18n-keys for the TK constants.

Parity with .NET

Mirrors DcsvIo.D2.ErrorCodes.Category (ErrorCategory.g.cs). Both are generated from the same contracts/error-category/error-category.spec.json source. A cross-runtime parity fixture (contract-tests/fixtures/error-category/mapping.json) asserts the .NET enum wire set ≡ this TS union ≡ the spec — drift structurally impossible.