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

@lowdep/http-snap

v1.0.0

Published

Snapshot HTTP API responses and detect structural changes over time — git-friendly, zero dependencies, CI-ready

Readme

http-snap

Zero dependencies Node License: MIT Platform

Save a snapshot of an HTTP API's response structure, then check if the structure ever changes.

Ignores value changes — only flags when keys are added, removed, or change type. Snapshots are stored as plain JSON files you can commit to git, so your whole team gets alerted when an upstream API breaks.


Why?

Existing tools compare two live endpoints simultaneously (like api-diff) or require a cloud account.
http-snap is different:

  • Save once → check anytime later
  • Structural-only diff: ignores value changes, only catches schema breakage
  • Git-friendly: snapshots live in .http-snaps/ → commit them
  • CI-ready: --strict exits 1 on any structural change
  • Zero dependencies: pure Node.js built-ins

Install

npm install -g http-snap

Or run without installing:

npx http-snap save my-api https://api.example.com/endpoint

Usage

# Save a snapshot
http-snap save <name> <url>

# Check for structural changes
http-snap check <name> <url>

# List all saved snapshots
http-snap list

# Show a saved snapshot's structure
http-snap show <name>

Examples

# Save the shape of a GitHub user response
http-snap save github-user https://api.github.com/users/octocat

# Check it a week later
http-snap check github-user https://api.github.com/users/octocat

# Compare staging vs saved production snapshot
http-snap check prod-users https://staging.myapp.com/api/users/1

# With auth header
http-snap save orders https://api.myapp.com/orders/1 --header "Authorization: Bearer $TOKEN"

# CI mode — fail the pipeline if structure changed
http-snap check prod-users https://api.myapp.com/users/1 --strict

Example Output

No changes:

http-snap — Structural diff for "github-user"
  Snapshot: https://api.github.com/users/octocat  (saved 2026-05-20T10:00:00Z)
  Current:  https://api.github.com/users/octocat

✓ No structural changes detected.

Changes detected:

http-snap — Structural diff for "prod-users"

⚠  3 structural change(s) found:

  + .data.subscription          → {"plan":"string","expiresAt":"string"}
  - .data.legacyPlan            was "string"
  ~ .data.role                  string → number

CI Integration

# .github/workflows/api-monitor.yml
name: API Snapshot Check
on:
  schedule:
    - cron: '0 9 * * 1-5'   # every weekday morning
  push:

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npx http-snap check prod-api https://api.myapp.com/health --strict

Commit your .http-snaps/ folder. When the API changes, the CI job fails.


How It Works

  1. Fetch the URL and parse the JSON response
  2. Extract shape: recursively walk the JSON, replacing all values with their type ("string", "number", "boolean", "null", or nested shape)
  3. Save/compare the shape as JSON in .http-snaps/<name>.json
  4. Diff: find keys added, removed, or changed type — ignore value changes

Array items: the shape of the first element is used as representative.
Nesting depth is capped at 8 levels to keep snapshots readable.


Snapshots Directory

Snapshots are stored in .http-snaps/ relative to where you run the command.

.http-snaps/
  github-user.json
  prod-api.json
  staging-orders.json

Each file looks like:

{
  "name": "github-user",
  "url": "https://api.github.com/users/octocat",
  "status": 200,
  "savedAt": "2026-05-20T10:00:00.000Z",
  "shape": {
    "login": "string",
    "id": "number",
    "avatar_url": "string",
    "public_repos": "number"
  }
}

License

MIT


Keywords

api snapshot · response schema · contract testing · api structure diff · schema snapshot · api regression · json shape · api monitoring · zero dependencies · cli


Built to solve, shared to help — Rushabh Shah 🛠️✨

One of 40+ zero-dependency developer CLI tools — no node_modules, ever.