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

nark-corpus

v0.4.2

Published

Contract library for nark — YAML definitions of error handling requirements for npm packages

Readme

nark-corpus

Contract library for nark — YAML definitions of error handling requirements for 169+ npm packages.

This is the contract library used by nark, the contract coverage scanner. It contains 169+ contracts that describe how npm packages fail at runtime and what error handling callers must provide.

What's a Contract?

A contract is a YAML file that describes:

  • Which functions/methods in a package can fail
  • How they fail (thrown errors, rejected promises, error events)
  • What callers must do to handle those failures

Example contract for axios:

package: axios
version: ">=0.21.0"
status: stable
imports:
  - module: axios
    default: axios
    named: [isAxiosError, AxiosError]
postconditions:
  - id: network-error-handling
    description: "HTTP requests must be wrapped in try-catch"
    severity: error
    trigger:
      function_call:
        object: axios
        methods: [get, post, put, patch, delete, request, head, options]
    requires:
      error_handling:
        type: try-catch

Structure

nark-corpus/
├── packages/
│   ├── axios/
│   │   ├── contract.yaml     # Contract definition
│   │   ├── SOURCES.md        # Research sources
│   │   └── fixtures/         # Test fixtures
│   ├── @prisma/client/
│   │   ├── contract.yaml
│   │   ├── SOURCES.md
│   │   └── fixtures/
│   └── ...149 more packages
├── schema/
│   └── contract.schema.json  # JSON Schema for contracts
├── scripts/
│   └── validate-contracts.js # Validation script
└── package.json

Covered Packages (169+)

| Category | Packages | |----------|----------| | HTTP clients | axios, got, node-fetch, undici, superagent, ky | | Databases | prisma, knex, sequelize, typeorm, drizzle-orm, pg, mysql2, better-sqlite3, mongoose | | Redis | ioredis, redis | | Cloud - AWS | @aws-sdk/client-s3, client-dynamodb, client-ses, client-sqs, and more | | Cloud - GCP | @google-cloud/storage, bigquery, pubsub, firestore | | Cloud - Azure | @azure/storage-blob, cosmos, identity | | Auth | jsonwebtoken, bcrypt, passport, @clerk/, @auth0/ | | Queues | bullmq, amqplib, kafkajs, bee-queue | | AI/ML | openai, @anthropic-ai/sdk, @langchain/, @mistralai/ | | Email | nodemailer, @sendgrid/mail, resend, postmark | | Payments | stripe, @paypal/checkout-server-sdk | | Frameworks | express, fastify, @nestjs/, @hapi/ | | File/Storage | sharp, multer, fs-extra, archiver | | Monitoring | @sentry/node, winston, pino, @datadog/* | | And more... | 50+ additional packages |

Using the Corpus

With nark (recommended)

npm install nark nark-corpus
npx nark --tsconfig ./tsconfig.json

Programmatic access

import { getCorpusPath, getSchemaPath, getCorpusInfo } from 'nark-corpus';

// Get the path to the packages directory
const corpusPath = getCorpusPath();

// Get version and path info
const info = getCorpusInfo();

Validate contracts

npm run validate

Contributing a Contract

  1. Create packages/<name>/contract.yaml following the schema
  2. Add SOURCES.md linking to official docs, error references, changelogs
  3. Add test fixtures in packages/<name>/fixtures/
  4. Run npm run validate to check your contract
  5. Submit a PR

See schema/contract.schema.json for the full contract schema.

License

CC-BY-4.0 — contracts are freely usable with attribution.