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

api-schema-time-machine

v0.1.1

Published

Zero-config API response schema tracker — plug into any Express app

Readme

api-schema-time-machine

npm version license node

Zero-config API response schema tracker — plug into any Express app and automatically detect when your upstream API responses change shape.

Why?

Upstream APIs change silently. A field gets renamed, a type switches from string to number, a nested object disappears — and you only find out when something breaks in production. api-schema-time-machine sits between your app and the upstream, fingerprints every JSON response, and alerts you the moment the shape changes. No annotations, no code generation, no schema files to maintain.

Install

npm install api-schema-time-machine

Quickstart

const express = require('express');
const { schemaTracker } = require('api-schema-time-machine');

const app = express();

app.use(schemaTracker({ target: 'https://api.example.com' }));

app.listen(3000);

Open http://localhost:3000/schema-tracker to see the dashboard — all tracked endpoints, their snapshot history, and a diff view of the latest change.

Configuration

| Option | Type | Default | Description | |---|---|---|---| | target | string | required | Upstream base URL to proxy requests to | | db | string | undefined | Storage connection. undefined/sqlite:// → SQLite. postgres://… → PostgreSQL. Bare path → SQLite at that path | | dashboard | boolean | true | Mount the schema dashboard UI | | dashboardPath | string | "/schema-tracker" | URL path where the dashboard is served | | ignoreRoutes | string[] | ["/health", "/favicon.ico"] | Paths to skip tracking entirely | | onSchemaChange | async (diff, path) => void | undefined | Callback fired whenever a schema change is detected |

Storage

SQLite (default, zero config) — data is written to .schema-tracker/tracker.db in your project directory. No setup required.

PostgreSQL (opt-in) — install the pg package and pass a connection string:

npm install pg
app.use(schemaTracker({
  target: 'https://api.example.com',
  db: 'postgres://user:password@localhost:5432/mydb',
}));

Dashboard

The built-in dashboard shows all tracked endpoints, their full snapshot history, and a diff view of the latest schema change.

http://localhost:3000/schema-tracker

How it works

  • Every JSON response from the proxied upstream is fingerprinted — each value is reduced to its type ("string", "number", "boolean", "null", or a nested structure).
  • The fingerprint is compared against the last stored snapshot for that endpoint. If it differs, a diff is computed and stored.
  • Diffs are computed at the dot-notation field level: added, removed, changed, and renamed fields are all tracked separately.

Contributing

Contributions are welcome. Fork the repo, create a branch, and open a pull request.

npm test   # run the test suite before submitting

Please keep PRs focused — one fix or feature per PR.

License

MIT © [email protected]