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

go-mokapi

v0.39.0

Published

Easy and flexible API mocking

Readme

What is Mokapi?

Mokapi is an open-source API mocking tool that lets you develop and test without waiting for backends. Mock REST APIs, Kafka topics, LDAP directories, and SMTP servers using OpenAPI and AsyncAPI specifications.

Perfect for:

  • Frontend developers building UIs before backends exist
  • QA teams testing edge cases, errors, and timeouts
  • DevOps engineers running reliable CI/CD tests without external dependencies
  • API designers prototyping and validating contracts early

Quick Start

Try Instantly

npx go-mokapi https://petstore3.swagger.io/api/v3/openapi.json

Then test your mock:

curl http://localhost/api/v3/pet/1 -H 'Accept: application/json'

Install Globally

npm install -g go-mokapi
mokapi https://petstore3.swagger.io/api/v3/openapi.json

Other Installation Methods

Check other installation methods here

Key Features

Multi-Protocol Support

Mock HTTP/HTTPS, Apache Kafka, LDAP, and SMTP — all from a single tool.

Specification-Driven

Uses OpenAPI and AsyncAPI specs as the source of truth. Your mocks stay aligned with your API contracts.

Dynamic Behavior with JavaScript

Control responses, simulate errors, add delays, or create complex workflows using embedded JavaScript:

import { on } from 'mokapi'

export default function() {
    on('http', (request, response) => {
        // Return 404 for specific IDs
        if (request.path.petId === '999') {
            response.statusCode = 404
            return
        }

        // Customize response data
        response.data.name = 'Custom Pet Name'
    })
}

Everything as Code

Version control your mocks alongside your code. Run them in CI/CD pipelines. No UI configuration required.

Configuration Patching

Override parts of your OpenAPI spec without modifying the original file. Perfect for testing different scenarios.

Built-in Dashboard

Visualize requests, responses, and logs in real-time at http://localhost:8080

Multiple Providers

Load specs from local files, HTTP URLs, Git repositories, or NPM packages.

Common Use Cases

Frontend Development

Mock backend APIs while building UIs. Test loading states, errors, and edge cases without waiting for real endpoints.

API Testing

Simulate timeouts, 500 errors, rate limits, and malformed responses. Test how your application handles failures.

CI/CD Integration

Run fast, reliable tests without external dependencies. No flaky tests due to network issues or unavailable services.

Contract Validation

Validate that your requests and responses match your OpenAPI specification. Catch breaking changes early.

Example Tutorials

Explore tutorials that walk you through mocking different protocols and scenarios:

More examples mokapi.io/resources

Documentation

Support the Project

If Mokapi helps your team ship faster, consider supporting development:

License

MIT License - see LICENSE for details.

Links