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

wirecraft

v1.1.0

Published

A zero-dependency local API gateway, mock engine, traffic studio, and replay tool.

Readme

WireCraft

WireCraft is a zero-dependency local API gateway, mock engine, streaming reverse proxy, signed-webhook validator, chaos testing simulator, and live HTTP traffic studio built 100% with Node.js standard library modules.


⚡ Quick Start (npx CLI)

Run instantly without cloning or installing dependencies:

# Instant launch on port 3000
npx wirecraft

# Custom port and upstream backend proxy
npx wirecraft --port 8080 --upstream https://api.staging.example.com

# Simulate network latency and chaos errors (20% failure rate, 300ms delay)
npx wirecraft --chaos 20 --delay 300

Open http://localhost:3000/_inspect for the real-time Server-Sent Events (SSE) Traffic Studio.


🛠️ CLI Options

| Flag | Shorthand | Description | Default | | :--- | :--- | :--- | :--- | | --port <number> | -p | HTTP port to listen on | 3000 / $PORT | | --upstream <url> | -u | Upstream backend URL to proxy unmatched requests | None (Echo fallback) | | --routes <path> | -r | Custom path to routes.json file | ./routes.json | | --chaos <percent> | -c | Injects random 500/502/503/504 errors ($0-100%$) | 0 (Off) | | --delay <ms> | -d | Global minimum simulated network latency in ms | 0 (Off) | | --stripe-secret <s> | | Stripe Webhook Secret for HMAC verification | $STRIPE_WEBHOOK_SECRET | | --github-secret <s> | | GitHub Webhook Secret for HMAC verification | $GITHUB_WEBHOOK_SECRET | | --version | -v | Display version | v1.1.0 | | --help | -h | Display help and usage examples | |


🎭 Dynamic Mock Templating

routes.json is re-read automatically on every request without requiring a server restart. WireCraft supports powerful built-in dynamic interpolation tags:

{
  "method": "GET",
  "path": "/api/users/:userId/orders/:orderId",
  "status": 200,
  "response": {
    "userId": "{{params.userId}}",
    "orderId": "{{params.orderId}}",
    "uuid": "{{uuid}}",
    "createdAt": "{{timestamp}}",
    "status": "{{randomChoice:processing,confirmed,in_transit,delivered}}",
    "trackingNumber": "TRK-{{randomInt:100000-999999}}"
  }
}
### Supported Template Tags:
- `{{params.name}}`: Path parameters from `:name` or `*wildcard`
- `{{query.name}}`: URL query string values
- `{{body.name}}`: JSON body properties
- `{{headers.name}}`: Incoming request header values
- `{{uuid}}`: Generates a cryptographic `v4` UUID
- `{{timestamp}}`: ISO 8601 UTC timestamp (`2026-08-31T...`)
- `{{now}}`: Unix timestamp in milliseconds
- `{{randomInt:min-max}}`: Random integer in range (e.g. `{{randomInt:100-999}}`)
- `{{randomChoice:a,b,c}}`: Random item from a comma-separated list

---

## 🛡️ Webhook Signature Verification & Dispatcher

### 1. Verification
WireCraft validates incoming webhook signatures natively using constant-time HMAC-SHA256 comparisons (`node:crypto`):
- **Stripe**: Validates `Stripe-Signature` with 5-minute replay tolerance (`t=...,v1=...`).
- **GitHub**: Validates `X-Hub-Signature-256` (`sha256=...`).

### 2. Built-in Webhook Dispatcher
In the Traffic Studio UI (**Webhook Tester** tab), craft any Stripe or GitHub event payload and dispatch it to your local or remote application. WireCraft automatically generates valid HMAC signatures on the fly.

---

## 📦 Traffic Export (HAR 1.2)

Click the **Export HAR** button in the Traffic Studio header to export all captured traffic into standard `.har` (HTTP Archive 1.2) format, ready to import into Chrome DevTools, Postman, Insomnia, or attach to bug reports.

---

## Design notes and limits

- CORS is enabled for every response and `OPTIONS` preflights return `204`.
- Request bodies are buffered in memory and capped at 10 MB; this is a local developer tool, not a large-upload proxy.
- SSE clients are held in process and receive events only while connected; MicroMock intentionally has no database or persistence layer.
- The inspector displays request headers and payloads. Do not expose it to untrusted networks or send real secrets to it.
- Replay can make requests to any supplied HTTP(S) URL. Keep the endpoint local/private when handling untrusted input to avoid SSRF risk.

## Verification

```sh
npm run test
npm ls --omit=dev

The test command performs Node's built-in syntax check. The dependency command output is checked into deps-proof.txt.

Hackathon fit

  • Track C — Web & Network: concurrent native HTTP server, protocol-correct CORS/SSE, and native outbound HTTP(S) replay.
  • Track A — Developer Tools & CLI: fast local mocking and webhook debugging with a clean single-command startup surface.
  • Single File bonus: all executable application logic and the dashboard live in server.mjs.