</>PackageGraphPackageGraph

router

npmv2.2.0

Simple middleware-style router

Adopt with care

router is usable, with caveats. Last published 532 days ago. 3 releases in the last 2 years.

  • AAdoption: grade A, Excellent.

    59.4M downloads per week and 1 known dependents.

  • CMaintenance: grade C, Fair — worth a look.

    Last published 532 days ago. 3 releases in the last 2 years.

  • BWeight: grade B, Good.

    Pulls in 6 transitive packages, about 192 KB installed.

  • ASupply chain: grade A, Excellent.

    No install scripts, 3 maintainers, and a contained dependency surface.

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding router to a project.

5
Direct dependencies

Runtime packages this one declares itself.

6
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

192 KB
Install size

Unpacked size of this package plus its entire runtime tree.

2
Tree depth

Longest resolved dependency chain below this package.

Licenses in the dependency tree

MIT

Every license you inherit by installing router, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
node >= 18
Module format
CommonJS only
TypeScript
No bundled types
Install scripts
None

Quick start

A usage example from the router README.

var finalhandler = require('finalhandler')
var http = require('http')
var Router = require('router')

var router = Router()
router.get('/', function (req, res) {
  res.setHeader('Content-Type', 'text/plain; charset=utf-8')
  res.end('Hello World!')
})

var server = http.createServer(function (req, res) {
  router(req, res, finalhandler(req, res))
})
Example truncated — see the full README.

Dependencies

Declared by router v2.2.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (6)

finalhandler ^2.1.0mocha 10.2.0nyc 15.1.0run-series ^1.1.9standard ^17.1.0supertest 6.3.3

Used by

Popular packages that depend on router.

Relationship graph

Dependencies (left) and dependents (right) of router.

Frequently installed together

Release history

2 releases in the last two years, typically about 154 days apart.

Recent versions of router
VersionPublishedSizeLicense
2.2.0latest1 year ago46 KBMIT
2.1.01 year ago46 KBMIT
2.0.02 years ago46 KBMIT
2.0.0-beta.22 years ago44 KBMIT
1.3.83 years ago42 KBMIT
1.3.74 years ago41 KBMIT
1.3.64 years ago40 KBMIT
2.0.0-beta.16 years ago42 KBMIT
1.3.56 years ago40 KBMIT
1.3.46 years ago39 KBMIT
2.0.0-alpha.18 years ago40 KBMIT
1.3.38 years ago39 KBMIT
1.3.29 years agoMIT
1.3.19 years agoMIT
1.3.09 years agoMIT

Overview

router is an npm package that simple middleware-style router. It is extremely widely used, with about 59.4M downloads per week and 1 known dependents in the graph. The latest version is 2.2.0, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need simple middleware-style router and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (59.4M weekly downloads).
  • Clear open-source license (MIT).

Cons

  • No bundled TypeScript types (may require a separate @types package).

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Frequently asked questions

Should I use router?

router is usable, with caveats. Last published 532 days ago. 3 releases in the last 2 years.

How do I install router?

Run `npm install router` to add router to your npm project.

How many dependencies does router have?

router declares 11 direct dependencies and pulls in 6 packages in total once its runtime tree is resolved totalling about 192 KB on disk.

What license is router released under?

router is distributed under the MIT license.

How popular is router?

router has approximately 59,413,889 downloads per week and 1 known dependent packages.

Is router still maintained?

The most recent release of router (v2.2.0) was published 1 year ago.

Does router run install scripts?

No. router does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.