</>PackageGraphPackageGraph

sirv

npmv3.0.2TypeScript

The optimized & lightweight middleware for serving requests to static assets

Adopt with care

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

  • AAdoption: grade A, Excellent.

    32.8M downloads per week and 3 known dependents.

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

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

  • AWeight: grade A, Excellent.

    Pulls in 3 transitive packages, about 65 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • 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 sirv to a project.

3
Direct dependencies

Runtime packages this one declares itself.

3
Total installed

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

65 KB
Install size

Unpacked size of this package plus its entire runtime tree.

1
Tree depth

Longest resolved dependency chain below this package.

Licenses in the dependency tree

MIT

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

Compatibility

Node.js
node >=18
Module format
ESM + CommonJS
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the sirv README.

const sirv = require('sirv');
const polka = require('polka');
const compress = require('compression')();

// Init `sirv` handler
const assets = sirv('public', {
  maxAge: 31536000, // 1Y
  immutable: true
});

polka()
  .use(compress, assets)
  .use('/api', require('./api'))
  .listen(3000, err => {
Example truncated — see the full README.

Dependencies

Declared by sirv v3.0.2. Runtime dependencies are installed with the package; dev dependencies are not.

Used by

Popular packages that depend on sirv.

Relationship graph

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

Frequently installed together

Release history

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

Recent versions of sirv
VersionPublishedSizeLicense
3.0.2latest1 year ago21 KBMIT
3.0.11 year ago21 KBMIT
3.0.01 year ago21 KBMIT
2.0.42 years ago20 KBMIT
2.0.33 years ago20 KBMIT
2.0.24 years ago29 KBMIT
2.0.04 years ago20 KBMIT
1.0.194 years ago20 KBMIT
1.0.184 years ago20 KBMIT
1.0.175 years ago20 KBMIT
1.0.165 years ago20 KBMIT
1.0.155 years ago20 KBMIT
1.0.145 years ago20 KBMIT
1.0.135 years ago20 KBMIT
1.0.125 years ago21 KBMIT

Overview

sirv is an npm package that the optimized & lightweight middleware for serving requests to static assets. It is extremely widely used, with about 32.8M downloads per week and 3 known dependents in the graph. The latest version is 3.0.2, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need the optimized & lightweight middleware for serving requests to static assets and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (32.8M weekly downloads).
  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).
  • Lean dependency tree (3 direct dependencies).

Cons

  • No significant drawbacks detected from available metadata.

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

Maintainers

Frequently asked questions

Should I use sirv?

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

How do I install sirv?

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

How many dependencies does sirv have?

sirv declares 3 direct dependencies and pulls in 3 packages in total once its runtime tree is resolved totalling about 65 KB on disk.

What license is sirv released under?

sirv is distributed under the MIT license.

How popular is sirv?

sirv has approximately 32,768,823 downloads per week and 3 known dependent packages.

Is sirv still maintained?

The most recent release of sirv (v3.0.2) was published 1 year ago.

Does sirv run install scripts?

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