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

http-log-replay

v1.2.0

Published

Traffic Mirror is a regression testing tool that records HTTP traffic from a live environment and replays it against two different environments (e.g., Stable vs. Canary) to detect differences in responses.

Readme

🚦 Traffic Mirror (http-log-replay)

Regressions No More. Record production traffic and replay it against your changes to verify correctness with zero effort.

npm version License: ISC

Traffic Mirror is a powerful regression testing tool designed for modern engineering teams. It allows you to record HTTP traffic from a live environment (like Production) and replay it against two different target environments (e.g., Stable vs. Canary) to instantly detect regressions, bugs, or side-effects.


📋 Table of Contents


🌟 Features

  • 🛡️ Zero-Config Recording: Acts as a transparent HTTP proxy to capture real requests.
  • ⚡ High-Performance Replay: Replay thousands of requests in parallel with customizable concurrency.
  • 🔍 Intelligent Diffing: compares JSON responses and ignores dynamic fields (like timestamps, UUIDs) that cause false positives.
  • 📊 Rich Reporting: Generates detailed HTML reports showing exactly what broke.
  • 🔌 Swagger Integration: Auto-generate test traffic from your OpenAPI definitions if you don't have live traffic.
  • 🏗️ Two Modes: Full interactive Web UI for debugging and a lightweight CLI for CI/CD pipelines.

🚀 Quick Start (Zero Setup)

You don't need to install anything if you have Node.js (v18+) installed. Just run:

npx http-log-replay ui --port 4200

This will launch the Traffic Mirror Dashboard at http://localhost:4200.


💻 Usage Guide: Web UI

The Web UI is the best way to get started. It guides you through the entire workflow in three simple tabs.

1. 🔴 Record / Generate

  • Manual Mode: Start the proxy, point your application/client to it, and select desired HTTP methods (e.g., GET, POST).
  • Auto-Generate: Upload an OpenAPI/Swagger JSON file to automatically generate realistic traffic patterns.
  • YAML Config Mode: Load a config.yaml file to pre-configure Traffic Generation (target, source, exclusions, timeouts, methods).

2. ▶️ Replay

  • Configure your Primary (Stable) and Secondary (Test) environments.
  • Set Concurrency to speed up large suites.
  • Add Ignore Fields (e.g., createdAt, traceId) to filter out noise in the comparison.
  • Click Replay & Compare.

3. 📄 Report

  • Instantly view the results.
  • Green: Exact match.
  • Red: Mismatch (click to expand the JSON diff).

🖥️ Usage Guide: CLI

Perfect for CI/CD pipelines or headless environments.

1. Record Traffic

Start a recording proxy on port 3000 forwarding to your real API at localhost:8080.

# Run from source
node index.js record --target http://localhost:8080 --port 3000 --out traffic.jsonl

2. Auto-Generate from Swagger

Generate traffic without manual clicking. You can use command line flags or a YAML configuration file.

Using Configuration File (Recommended):

node index.js generate --config config.example.yaml

Using Flags:

node index.js generate --file ./openapi.json --target http://localhost:3000

3. Replay & Verify

Replay recorded traffic against two environments and generate an HTML report.

node index.js replay \
  --log traffic.jsonl \
  --primary http://prod-api.com \
  --secondary http://staging-api.com \
  --report report.html \
  --ignore "timestamp,id"

🐳 Usage Guide: Docker

We provide optimized Docker images for both the UI and CLI.

Prerequisites

  • Docker & Docker Compose installed.

Option A: Complete Environment (Recommended)

Use the included docker-compose.yml to run everything.

Start the GUI:

docker-compose up gui

Access at http://localhost:4200. Data is persisted to your host folder.

Run CLI Commands:

docker-compose run cli record --target http://host.docker.internal:8080 ...

Option B: Manual Docker Run

UI Image:

docker run -p 4200:4200 -v $(pwd):/app traffic-mirror-gui

CLI Image:

docker run -v $(pwd):/app traffic-mirror-cli --help

🛠️ Development & Contribution

We welcome contributions! Here is how to run the project locally for development.

1. Setup

git clone https://github.com/your-username/http-log-replay.git
cd http-log-replay
npm install

2. Build the UI

The UI is built with Angular. You must build it before running the app.

cd ui
npm install
npm run build
cd ..

3. Run Locally (Dev Mode)

# Start the full app (Frontend + Backend)
node index.js ui --port 4200

4. Testing & Code Quality

We use Jest for testing and ESLint for code quality.

# Run Unit Tests
npm test

# Lint Code
npm run lint

# Format Code
npm run format

# Production Start (PM2)
npm run start:pm2

5. Contribution Guidelines

We use Semantic Release to automate version management and package publishing. To ensure this works correctly, please follow the Conventional Commits specification for your commit messages.

Commit Message Format:

<type>(<scope>): <subject>

Common Types:

  • feat: A new feature (triggers a MINOR release).
  • fix: A bug fix (triggers a PATCH release).
  • docs: Documentation only changes (triggers a PATCH release).
  • refactor: A code change that neither fixes a bug nor adds a feature (triggers a PATCH release).
  • perf, test, ci, chore: Changes that do not trigger a release (unless configured otherwise).

📦 Maintenance

Publishing to NPM

  1. Bump Version: Update version in package.json.
  2. Build UI: The prepublishOnly script will automatically build the Angular UI.
  3. Publish:
    npm publish

File Structure

  • index.js: CLI entry point.
  • recorder.js: Proxy logic.
  • replayer.js: Replay & Diff logic.
  • server.js: Express server for the UI.
  • ui/: Angular frontend source code.
  • tests/: Jest unit tests.

Built with ❤️ by the Traffic Mirror Team.