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

@xirconsss/zero-mock

v1.3.0

Published

Zero-config CLI that generates REST APIs from JSON files

Readme

zero-mock

License: MIT TypeScript npm version

zero-mock is a zero-config Node.js CLI that turns any JSON file into a persistent, production-grade REST API in seconds. It includes an interactive setup wizard, a high-contrast brutalist UI, and smart schema inference with automatic validation.

Built for frontend developers and architects who need a realistic, stable backend for prototypes, demos, and integration tests without the overhead of database orchestration.

Key Features

  • Zero-config — your JSON file is your database and API definition.
  • Interactive wizard — run zero-mock to start the setup guide.
  • Smart validation — automatically infers Zod schemas from your data to validate POST, PUT, and PATCH requests.
  • Atomic and secure — cross-platform atomic writes (Windows-safe) with file-locking to prevent data corruption.
  • Advanced REST — supports filtering (_gte, _lte, _like), sorting (_sort, _order), and pagination (_page, _limit).
  • Realistic simulation — simulate network latency and configure custom CORS origins/methods.
  • Watch mode — hot-reloads data from disk on manual file changes without a server restart.
  • Session memory — remembers your last used configuration for a faster workflow.

Installation

Global

npm install -g @xirconsss/zero-mock

Run the CLI as zero-mock.

One-off with npx

npx @xirconsss/zero-mock

Usage

1. Interactive mode (recommended)

Run the command without arguments to launch the setup wizard:

zero-mock

2. Manual CLI

Pass flags to skip the wizard:

zero-mock -f ./data.json -p 8080 -w -d 200

| Flag | Description | | ---- | ----------- | | -f, --file | Path to the source JSON file. | | -p, --port | HTTP port (default 3000, must be 1024–65535). | | -d, --delay | Delay every request by X milliseconds (default 0). | | -w, --watch | Enable hot-reloading on manual file changes. | | --cors-origin | Comma-separated allowed origins (default *). | | --reset | Clear saved wizard configuration and exit. |


Auto-generated API

The tool generates full CRUD endpoints for every top-level key in your JSON (e.g., users, posts).

| Method | Path | Description | | ------ | ---- | ----------- | | GET | /{resource} | List items (supports filtering, sorting, paging). | | POST | /{resource} | Create item (auto-id + schema validation). | | GET | /{resource}/{id} | Return a single item by id. | | PUT | /{resource}/{id} | Replace item (schema validation). | | PATCH | /{resource}/{id} | Partial update (schema validation). | | DELETE | /{resource}/{id} | Remove item. |

Advanced List Features

Filtering

  • GET /posts?category=tech — exact match
  • GET /posts?views_gte=100 — greater than or equal
  • GET /posts?title_like=hello — case-insensitive search

Sorting

  • GET /posts?_sort=createdAt&_order=desc

Pagination

  • GET /posts?_page=1&_limit=10
  • Returns an X-Total-Count header and a wrapped { data, pagination } object.

JSON Structure

The root must be an object, and every resource must be an array.

{
  "users": [
    { "id": 1, "name": "Alice", "role": "admin" },
    { "id": 2, "name": "Bob" }
  ]
}

Note: zero-mock automatically infers that role is an optional string based on the items above.


Development

  1. Clone the repo.
  2. npm install
  3. npm run dev (runs with ts-node)
  4. npm run build (compiles to dist/)

Publishing (Maintainers)

This project uses semantic-release for fully automated versioning and npm publishing.

  1. Ensure your commits follow the Conventional Commits format (e.g., feat:, fix:, chore:).
  2. Push or open a PR against the main branch.
  3. GitHub Actions handles testing, version bumping, changelog generation, and publishing to npm.

License

MIT — see LICENSE.


Links