Simple middleware-style router for Node.js, useful for routing HTTP requests and composing request handlers using `router(req, res, callback)` with `http.createServer` or other web frameworks. It supports typical routing methods like `router.get` and `router.use`, plus options for strictness and case sensitivity, and `router.param` for parameter-specific middleware.
Project status
- Actively maintained: Tag history shows updates through v2.2.0 (2025-03-27), and the repo had an upstream push on 2026-06-02, which suggests continued maintenance activity even though no newer tagged update is listed here.
- Update cadence (apparent): Major/minor updates appear roughly every 1 to 2 months around early 2025 (v2.1.0 on 2025-02-10, v2.2.0 on 2025-03-27), after a longer quiet period since 2023 (v1.3.8).
AI summary generated Today
Recent updates
v2.2.0
3/27/2025v2.2.0 adds more runtime debug logging and introduces deprecation warnings when route handlers or .param handlers return promise-like values instead of native Promises. It also removes older compatibility checks (notably around setImmediate and test-time Promise detection) and updates several dependencies/devDependencies.
Featuresv2.1.0
2/10/2025v2.1.0 focuses on internal refactors to remove small helper dependencies and polyfills, switching to Node.js and standard-library equivalents such as Array.flat, Object.setPrototypeOf, and node:http METHOD constants. It also updates a few runtime dependencies (parseurl, is-promise) and refreshes CI tooling and configuration.
BreakingFeaturesv1.3.8
2/24/2023Release v1.3.8 focuses on fixing how the router handles requests where the HTTP method is missing. The runtime change prevents `toLowerCase()` from throwing and allows routes like `route.all(...)` to be selected when `req.method` is `undefined`.
v1.3.7
4/28/2022Release v1.3.7 is described as a fix for hanging when there is a large stack of synchronous routes. The diff shows the router’s internal request handling logic was adjusted to better handle large synchronous route stacks, and a regression test was added to cover this scenario.
v2.0.0-beta.1
11/16/2021Router 2.0.0-beta.1 refactors core routing internals, removes the `debug` dependency, and upgrades routing to align with `path-to-regexp@3.2.0` semantics. The diff also shows additional runtime behavior changes that are not described in the provided release notes, including promise rejection handling.
BreakingFeaturesv1.3.6
11/16/2021Release 1.3.6 fixes handling for very large stacks of synchronous middleware to prevent stack overflows. It also bumps the safe-buffer dependency to v5.2.1.
v1.3.5
3/25/2020Release v1.3.5 focuses on fixing middleware execution for unanchored RegExp path patterns and making a small internal performance optimization. The code changes add explicit prefix validation during route layer matching and switch the route method map to a null-prototype object.
v1.3.4
1/25/2020Release v1.3.4 is presented as a small dependency-only update (array-flatten, parseurl, setprototypeof). The code diff, however, also includes several non-runtime changes to CI/test tooling and documentation formatting.
v2.0.0-alpha.1
9/19/2018Release 2.0.0-alpha.1 adds basic support for returned Promises from router middleware, wiring returned thenables into the router's `next(...)` error flow. It also drops support for Node.js versions below 0.10 and bumps `debug` to 3.1.0 with the related environment variable behavior changes described in the notes.
BreakingFeaturesv1.3.3
7/6/2018Release 1.3.3 is described as a documentation-only change, fixing the JSDoc for the Router constructor. The code diff also includes minor formatting-only edits and several non-runtime repo changes (tests, CI matrix, README), plus a devDependency bump.