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

apimock-rs

v4.6.5

Published

A developer-friendly, featherlight and functional HTTP(S) mock server built in Rust.

Readme

apimock-rs (API Mock)

npm crates.io License

Rust Documentation Dependency Status Releases Workflow App Docs Workflow

Build a working REST API in seconds — without a backend.

Frontend blocked by an unfinished backend ? Need stable API responses for UI tests or offline development ?

Drop JSON files into a folder and your API immediately exists.

Quick start

Easy to start with npm package.

# install into your app project
npm install -D apimock-rs
# and go
npx apimock
# just use folders and JSON
mkdir -p api/v1/
echo '{"hello": "world"}' > api/v1/hello.json
npx apimock

# response
curl http://localhost:3001/api/v1/hello
# --> {"hello":"world"}

You may also check it out with browser to visit http://localhost:3001/api/v1/hello .

You now have a running REST endpoint.

Customization

Also, there's room to tweak things later with optional config file(s):

npx apimock --init

Vite project integration

An example of scripts section in package.json is as below.

concurrently is used to run the Vite and API mock servers simultaneously, while cross-env enables terminal output coloring. Before starting, ensure you run:

npm install -D concurrently cross-env

Edit package.json:

  "scripts": {
    "apimock": "npx apimock",
    "dev": "cross-env CLICOLOR_FORCE=1 concurrently \"vite\" \"npm run apimock\""
  }

Run:

npm run dev

npx apimock variation

| command | result | | --- | --- | | npx apimock | Run with all default parameters. | | npx apimock -p 4000 | Run with custom port. | | npx apimock -d tests/apimock-dyn-route | Run with custom root dir on server response. | | npx apimock -c apimock.toml | Run with config file giving rich features. Running npx apimock --init beforehand is required. |

Mock APIs easily 🎈 — just JSON and go

If you’re building or testing APIs, this tool makes mocking painless. It’s super fast, efficient, and flexible when you need it to be. All you have to do to start up is just use folders and JSON without any config set.

  • ❄️ Zero-config start.
  • 🌬️ Fast to boot, light on memory.
  • 🪄 File-based and rule-based matching. Scripting supported.

When to use apimock-rs ?

  • The backend is not ready yet.
  • You need stable API responses for UI testing.
  • You want offline development.
  • CI tests require a predictable API.
  • Your mock data is becoming large.

Handles real project scale

As your project grows, your mock API grows, too. Large mock datasets often cause problems:

  • Slow startup
  • High memory usage
  • Crashes during UI testing
  • Unstable CI runs

apimock-rs does not preload responses. Each response file is read only when a request arrives using non-blocking I/O. This keeps:

  • Startup nearly instant
  • Memory usage minimal
  • Stable behavior under repeated requests

as validated with k6 load testing. You can run UI development and automated tests continuously without worrying about server instability.

📖 Documentation

For more details, 🧭 check out the docs.


Open-source, with care

This project is lovingly built and maintained by volunteers.
We hope it helps streamline your API development.
Please understand that the project has its own direction — while we welcome feedback, it might not fit every edge case 🌱

Acknowledgements

Depends on tokio / hyper / toml / serde / serde_json / json5 / console / rhai. In addition, mdbook (as to workflows).