express
Use when building APIs or web servers with Express.js — routing, middleware, error handling, or when working with the most widely-used Node.js HTTP framework. Also use when migrating Express apps or debugging Express-specific issues.
| Model | Source |
|---|---|
| sonnet | pack: backend |
Full Reference
┏━ 🔧 express ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when building APIs or web servers with Exp… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Express.js
Section titled “Express.js”Express.js is the most widely-used Node.js HTTP framework. Express 5 (stable, default on npm since March 2025) auto-forwards rejected promises to error middleware — no more try/catch boilerplate in async routes.
Quick Reference
Section titled “Quick Reference”| Item | Value |
|---|---|
| Current version | 5.x (stable, latest on npm) |
| Min Node.js | v18+ |
| Install | npm install express |
| TypeScript types | npm install -D @types/express |
| Key packages | helmet, cors, express-rate-limit, morgan, multer, compression |
| Docs | https://expressjs.com |
Reference Index
Section titled “Reference Index”| I want to… | File |
|---|---|
| Set up a TypeScript Express project from scratch | reference/setup.md |
| Define routes, params, and nested routers | reference/routing.md |
| Add middleware (built-in and custom) | reference/middleware.md |
| Handle errors with custom error classes | reference/error-handling.md |
| Secure with helmet, CORS, rate limiting, and Zod | reference/security.md |
| Implement JWT, session, or OAuth authentication | reference/auth.md |
| Handle file uploads with multer | reference/file-uploads.md |
| Test routes with supertest | reference/testing.md |
| Optimize with compression, caching, and PM2 | reference/performance.md |
| Migrate from Express 4 to Express 5 | reference/migration.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.