Stream-Level Capture
Intercepts raw HTTP streams — no body parser middleware required. Captures request and response bodies exactly as they flow.
Zero-dependency HTTP debug middleware
Stream-level request capture, smart body truncation, cURL generation, and framework adapters for Express, Fastify, Hono, and Next.js.
npm install http-debuggerimport express from 'express'
import { httpDebugger } from 'http-debugger/express'
const app = express()
app.use(httpDebugger())import Fastify from 'fastify'
import { httpDebugger } from 'http-debugger/fastify'
const fastify = Fastify()
fastify.register(httpDebugger)import { Hono } from 'hono'
import { httpDebugger } from 'http-debugger/hono'
const app = new Hono()
app.use('*', httpDebugger())// 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 })| Feature | http-debugger | Morgan | Pino |
|---|---|---|---|
| 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) | ✅ | ❌ | ❌ |