Skip to content

http-debugger

Zero-dependency HTTP debug middleware

Stream-level request capture, smart body truncation, cURL generation, and framework adapters for Express, Fastify, Hono, and Next.js.

http-debugger logo

Quick Start

bash
npm install http-debugger

Express

ts
import express from 'express'
import { httpDebugger } from 'http-debugger/express'

const app = express()
app.use(httpDebugger())

Fastify

ts
import Fastify from 'fastify'
import { httpDebugger } from 'http-debugger/fastify'

const fastify = Fastify()
fastify.register(httpDebugger)

Hono

ts
import { Hono } from 'hono'
import { httpDebugger } from 'http-debugger/hono'

const app = new Hono()
app.use('*', httpDebugger())

Next.js (App Router)

ts
// app/api/users/route.ts
import { withHttpDebugger } from 'http-debugger/next'

async function handler(req: Request) {
  return Response.json({ users: [] })
}

export const GET = withHttpDebugger(handler)

// app/__debugger/[[...route]]/route.ts
import { dashboardRoute } from 'http-debugger/next'

export const GET = dashboardRoute({ maxDepth: 4, sanitize: true })

Why http-debugger?

Featurehttp-debuggerMorganPino
Stream-level capture
Request body capture
Response body capture
Body truncation
cURL generation
Zero runtime deps
TypeScript support
Express
Fastify
Hono / Edge
Next.js (App Router)

Released under the MIT License with No-Resale Clause.