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

shapedrift

v0.1.0

Published

Know when your API response shape changes before your frontend breaks — snapshot-based contract diffing with one line of code.

Readme

shapedrift

Know when your API response changes before your frontend breaks.

One small problem. One obvious API. Very little setup. Immediate value.

Backend responses drift. Nothing tells you until a page breaks in production. OpenAPI, Zod and contract testers solve this — with ceremony. shapecheck (the npm command of shapedrift) gives you the middle ground: a snapshot of your API's shape, and a diff when it drifts.

Install

npm i shapedrift

Usage

import { shapecheck } from "shapedrift";

shapecheck("user", response);
first run    ✓ user — shape recorded
unchanged    ✓ user unchanged
drifted      ⚠ API SHAPE CHANGED — possibly breaking

Snapshot file .shapecheck/user.json:

{
  "label": "user",
  "updatedAt": "2026-09-28T11:28:14.876Z",
  "shape": {
    "id": "number",
    "name": "string",
    "profile": {
      "avatar": "null",
      "city": "string"
    },
    "roles": ["string"]
  }
}

Drift example:

⚠ API SHAPE CHANGED — possibly breaking

user

- user.name: string
~ user.email: string → number
~ user.profile.avatar: null → string  (was null)
+ user.full_name: string

3 breaking changes
1 non-breaking addition

Options

shapecheck("user", response, {
  snapshotDir: ".shapecheck",       // default ".shapecheck"
  failOnBreakingChange: true,       // sets process.exitCode = 1 for CI
  ignore: ["updated_at", "last_seen"],
});

Breaking (potentially): type changes, removed fields, object ↔ array. Non-breaking: added fields (snapshots auto-update for non-breaking drift so your baseline stays current).

Direct diff, no storage

import { diffShape } from "shapedrift";

diffShape(oldResponse, newResponse);
// { changed: true, breaking: true, changes: [{ kind: "typeChange", path: "user.email", from: "string", to: "number", ... }] }

CLI

List the contracts detected for your project:

npx shapecheck

Supported

  • string · number · boolean · null · undefined · bigint · date
  • nested objects, nested arrays, uniform arrays (roles: ["string"])
  • arrays of objects key-merged across items (users: [{ id, name }])

Zero dependencies. ESM + CJS + .d.ts + bin. Node >= 18.

License

MIT