Router
JSON →The `router` package provides a simple, middleware-style routing solution for Node.js HTTP servers. It is currently at version 2.2.0, with releases occurring periodically, often incorporating dependency updates and internal refactorings to reduce its external footprint, as seen in recent 2.x versions. This module was originally extracted from the Express project, offering a lightweight alternative that can be used directly with Node.js's native `http.createServer` or integrated into other web frameworks. Key differentiators include its minimalistic API, adherence to the familiar `(req, res, next)` middleware signature, and flexible routing capabilities through HTTP method-specific handlers (`router.get`, `router.post`, etc.) and general-purpose middleware (`router.use`). It supports asynchronous middleware, including Promises, and offers options for strictness, case sensitivity, and parameter merging.
Traffic · last 30 days ↓57% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France