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

har-proxy

v1.0.5

Published

A CLI tool that parses HAR files and creates a RESTful mock server

Readme

HAR Proxy

A CLI tool that parses HAR (HTTP Archive) files and creates a RESTful mock server. Perfect for API mocking, testing, and development without backend dependencies.

Installation

# Using npm
npm install -g har-proxy

# Using pnpm
pnpm add -g har-proxy

# Or run directly with npx
npx har-proxy <har-file>

Requirements

  • Node.js >= 18.0.0

Usage

har-proxy <har-file> [options]

Options

| Option | Description | Default | |--------|-------------|---------| | -p, --port <number> | Port to run the server on | 3000 | | --no-cors | Disable automatic CORS header injection | CORS enabled | | -V, --version | Output the version number | - | | -h, --help | Display help information | - |

Examples

# Start server with default port (3000)
har-proxy recording.har

# Start server on custom port
har-proxy recording.har --port 8080
har-proxy recording.har -p 8080

# Disable automatic CORS headers (use original HAR CORS headers)
har-proxy recording.har --no-cors

CORS Support

By default, har-proxy automatically adds CORS headers to all responses, allowing cross-origin requests from any domain:

  • Access-Control-Allow-Origin: *
  • Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS
  • Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With

The server also handles preflight OPTIONS requests automatically.

Note: If your HAR file already contains CORS headers, har-proxy will preserve them and not add duplicates.

Disabling CORS

Use --no-cors when:

  • You need to test CORS behavior with specific origins
  • Your frontend handles CORS differently
har-proxy recording.har --no-cors

When CORS is disabled, any CORS headers present in the original HAR recording will be preserved.

Important: Proxy Path

All HAR-recorded endpoints are served under the /proxy path prefix.

For example, if your HAR file contains a request to /api/users, it will be available at:

http://localhost:3000/proxy/api/users

This design separates HAR endpoints from internal routes (dashboard, health checks, etc.).

Path Mapping Examples

| Original HAR Path | Proxy Server Path | |-------------------|-------------------| | /api/users | /proxy/api/users | | /api/products/123 | /proxy/api/products/123 | | /v1/auth/login | /proxy/v1/auth/login |

Query Parameters

Query parameters in requests are automatically stripped for matching purposes. This means:

# Both of these will match the same HAR entry for GET /api/users
curl http://localhost:3000/proxy/api/users
curl http://localhost:3000/proxy/api/users?page=1&limit=10

This allows flexible testing without needing exact query parameter matches.

Dashboard

After starting the server, a web dashboard is available at the root path:

http://localhost:3000/

The dashboard displays all loaded endpoints grouped by base path, showing:

  • HTTP method (GET, POST, PUT, DELETE, PATCH)
  • Full endpoint path
  • Response status code
  • Content type

HAR Proxy Dashboard

Quick Start Example

  1. Export a HAR file from your browser's DevTools (Network tab → Right-click → Save all as HAR)

  2. Start the proxy server:

    har-proxy my-api-recording.har -p 3000
  3. Output:

    Loading HAR file: /path/to/my-api-recording.har
    
    🚀 HAR Proxy server running at http://localhost:3000
    📊 Dashboard available at http://localhost:3000/
    📦 Loaded 15 endpoints
    🌐 CORS: enabled (default)
    
    Press Ctrl+C to stop the server
  4. Access your mocked endpoints:

    # If HAR contained GET /api/users
    curl http://localhost:3000/proxy/api/users

How It Works

  1. Parse: Reads and parses the HAR file to extract HTTP request/response pairs
  2. Map: Creates an endpoint map where later entries override earlier ones (latest wins)
  3. Serve: Starts an HTTP server that matches incoming requests to recorded responses
  4. Dashboard: Generates an HTML dashboard for easy endpoint discovery

Use Cases

  • Frontend Development: Mock backend APIs during UI development
  • Testing: Create reproducible test environments with recorded responses
  • Demos: Showcase applications without live backend dependencies
  • Debugging: Replay specific API scenarios for troubleshooting

License

ISC