Express
Set up debugger in an Express.js project.
Last updated March 19, 2026
Express
This guide covers adding debugger to an Express project. The setup takes one line.
| Feature | Support |
|---|---|
| Server console | Yes |
| Server errors | Yes |
| HTTP requests | Yes |
| Browser script injection | Manual |
Install
npm install -D @ephem-sh/debugger
Set up
Import and call instrumentExpress with your Express app:
import express from 'express'
import { instrumentExpress } from '@ephem-sh/debugger/express'
const app = express()
instrumentExpress(app)
This sets up the log store, IPC bridge, console patching, and HTTP
middleware for the ingest endpoint and browser client script. It
no-ops when NODE_ENV is production.
Browser support
The middleware automatically serves /_/d.js and handles POST /_/d
for browser log ingestion. Add script tags before </body> in your
HTML templates:
<script>window.__DEBUGGER_INGEST_URL__="/_/d";</script>
<script src="/_/d.js" defer></script>
Verify
node index.ts
npx dbg statuspnpm dlx dbg statusbun x dbg statusyarn dlx dbg statusnpx dbg browser consolepnpm dlx dbg browser consolebun x dbg browser consoleyarn dlx dbg browser consolenpx dbg server consolepnpm dlx dbg server consolebun x dbg server consoleyarn dlx dbg server consoleFull example
See the complete working example at examples/node/expressjs.



