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

mockingpug

v2.0.0

Published

Declarative JSON-schema mock data generation and REST-like mocking for React/Next.js — no separate server.

Readme

mockingpug

CI License: MIT

Documentation · mockingpug.com

Declarative, JSON-schema-driven mock data generation and REST-like API mocking for React/Next.js. No separate mock server process, no hand-written fixture arrays, no imperative factory functions to maintain.

You describe each entity once, as a small JSON file (mock/api/user/schema.json):

{
  "amount": 1000,
  "data": {
    "id": "number.increment",
    "name": "username.FS",
    "email": "email[gmail.com]",
    "role": "role",
    "posts": "data.blogpost"
  }
}

and mockingpug generates 1000 deterministic, seed-stable records, resolves posts as a live join against another entity's schema, and serves them over the exact same /api/user endpoint your app would call in production, either by intercepting fetch() in the browser (MSW-based) or from a real Next.js App Router Route Handler.

Why not just hand-write fixtures / use Faker directly?

Hand-written fixture arrays and ad-hoc faker.js calls work fine for a handful of records, but stop scaling once you need cross-entity relations that stay consistent, deterministic reruns, incremental regeneration when a schema changes, or a real REST surface (pagination, field filtering, substring search, sorting, full CRUD) without hand-writing a handler per entity.

What's in this package

| Import | What it's for | |---|---| | mockingpug | Core: schema parsing, generators, seeded RNG, dependency graph. No framework dependency. | | mockingpug/cli | Programmatic access to the CLI commands (init, doctor, generate, migrate, reset, prune, types, docs, and cloud sync: login/link/pull). | | mockingpug/react | MSW handler generation, <MockProvider>/<MockDevtools>, bypass()/unbypass(). | | mockingpug/next | App Router catch-all Route Handler builder + context loader. | | mockingpug/next/client | <MockDevtools> for the Next.js transport. | | mockingpug/vite | Vite plugin: auto-discovers mock/api/**/mock/data/** as a virtual module. |

Plus a CLI binary (npx mpug <command>, alias npx mockingpug <command>) for scaffolding, validating, and generating data offline.

Getting started

npm install -D mockingpug
npx mpug init

Works the same under pnpm, yarn, bun, and deno — see src/cli/README.md for the equivalent install/run command on each, verified in CI.

See the full documentation at docs.mockingpug.com (source under site/content/docs) for the schema DSL, framework guides (React, Next.js, Vite), the CLI reference, and the security/performance notes. Runnable starters for every supported transport live under examples/.

Development

npm install
npm run typecheck
npm test
npm run build

See CONTRIBUTING.md for the full contributor workflow.

License

MIT