{"library":"router","type":"library","category":null,"description":"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.","language":"javascript","status":"active","version":"2.2.0","tags":["javascript"],"install":[{"cmd":"npm install router","imports":["import Router from 'router';","router(req, res, finalhandler(req, res));","router.use('/api', myMiddleware);","import finalhandler from 'finalhandler';"]},{"cmd":"yarn add router","imports":[]},{"cmd":"pnpm add router","imports":[]}],"homepage":null,"github":"https://github.com/pillarjs/router","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/router","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/router/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Tue Jul 21","install_tag":null}}