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

@pb33f/wiretap

v0.7.3

Published

The world's coolest OpenAPI contract compliance API Proxy testing tool.

Downloads

6,961

Readme

wiretap

logo

discord GitHub downloads npm Docker Pulls

wiretap is an API diagnostics, validation, proxying, and mocking tool for teams building against OpenAPI contracts.

Run it locally or in a pipeline to inspect real HTTP traffic, validate requests and responses, serve static frontends, replay HAR files, and simulate APIs from an OpenAPI description before the backend exists.

This is an early tool and in active development. Try it out and tell us what breaks, what helps, and what you want next.

Quick start

Quick Start Guide

Install

Homebrew

brew install pb33f/taps/wiretap

npm

npm install -g @pb33f/wiretap

cURL

curl -fsSL https://pb33f.io/wiretap/install.sh | sh

Docker

Images are published to both Docker Hub and GitHub Container Registry:

docker pull pb33f/wiretap
docker pull ghcr.io/pb33f/wiretap
docker run -p 9090:9090 -p 9091:9091 -p 9092:9092 --rm -v \
  $PWD:/work:rw pb33f/wiretap -u https://somehostoutthere.com
docker run -p 9090:9090 -p 9091:9091 -p 9092:9092 --rm -v \
  $PWD:/work:rw ghcr.io/pb33f/wiretap -u https://somehostoutthere.com

The default ports are 9090 for the API gateway, 9091 for the monitor UI, and 9092 for the monitor websocket.

Windows

Download the Windows build for your CPU from the latest GitHub release.

Run as a validation proxy

Send traffic through wiretap and forward it to a real upstream API:

wiretap -u https://api.pb33f.com

Add an OpenAPI contract to validate traffic:

wiretap -u https://api.pb33f.com -s ./openapi.yaml

Your client calls http://localhost:9090; wiretap validates and proxies the request, validates the response, and streams everything to the monitor UI.

Mock APIs from OpenAPI

wiretap is not only a passive proxy. It can run as a contract-driven API simulator.

Use full mock mode when the backend does not exist, is unstable, or should not be called during client tests:

wiretap -s ./openapi.yaml --mock-mode

In mock mode, no traffic is sent upstream. wiretap matches the incoming request to the OpenAPI operation, validates the request, chooses an appropriate response, and generates the response body from schemas and examples.

Mocking capabilities include:

  • Generate all responses from an OpenAPI contract with --mock-mode.
  • Mock only selected paths with mockModeList in wiretap.yaml, while other paths still proxy to an upstream API.
  • Select named OpenAPI examples by sending a Preferred: ExampleName request header.
  • Override the returned status code with wiretap-status-code: 404 after a successful mock body is generated.
  • Use --hard-validation to reject invalid mock requests, or --mock-bypass-validation / wiretap-bypass-validation: true to keep serving chosen examples for malformed fixture traffic.
  • Enable --strict-mode to detect undeclared properties, parameters, headers, and cookies.
  • Return non-JSON examples such as text/plain or text/html without JSON string wrapping.
  • Run with no upstream URL in full mock mode; an OpenAPI contract is the required input.

Path-scoped mocking example:

redirectURL: https://api.pb33f.com
contract: ./openapi.yaml
mockModeList:
  - /checkout/**
  - /beta/*
wiretap -c ./wiretap.yaml

Requests under /checkout/** and /beta/* return generated mocks. Everything else is proxied and validated against https://api.pb33f.com.

Static mock fixtures

For exact fixture-based mocks, point wiretap at a static mock directory:

wiretap -u https://api.pb33f.com --static-mock-dir ./mocks

Directory layout:

./mocks/
  mock-definitions/
    get-product.json
  body-jsons/
    product.json

Definition example:

{
  "request": {
    "method": "GET",
    "urlPath": "/products/123",
    "queryParams": {
      "view": "full"
    }
  },
  "response": {
    "statusCode": 200,
    "header": {
      "x-mock": "wiretap"
    },
    "bodyJsonFilename": "product.json"
  }
}

Static mocks can match method, host, path, headers, query parameters, and JSON or form request bodies. Response bodies can be inline or loaded from body-jsons/, and can use request data with template expressions such as ${queryParams.view}.

If no static mock matches, wiretap falls back to the normal proxy/mock handler. Mock definition JSON files are watched and reloaded while the service is running.

Multi-spec mode

Got more than one OpenAPI contract? Hand wiretap a list, or point it at a directory and let it discover them.

wiretap -u https://api.pb33f.com --specs ./users.yaml,./orders.yaml,./billing.yaml
wiretap -u https://api.pb33f.com --spec-dir ./contracts

wiretap routes each request to the spec that owns it and reports duplicate or ambiguous routes across contracts at startup.

Use --dry-run to discover, analyze, and print the conflict report without starting the proxy. It exits non-zero on conflicts or load errors, which makes it useful in CI.

wiretap --spec-dir ./contracts --dry-run

Full details: Multi-spec mode.

HAR and headless workflows

Load a HAR file into the monitor:

wiretap --har ./traffic.har

Validate a HAR file against OpenAPI without running the proxy:

wiretap --har ./traffic.har --har-validate -s ./openapi.yaml --har-allow /api

Stream validation violations to a report file while wiretap runs:

wiretap -u https://api.pb33f.com -s ./openapi.yaml \
  --stream-report \
  --report-filename ./wiretap-report.jsonl

Documentation