sirv
npmv3.0.2TypeScriptThe 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.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
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 => {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
Shared Vitest utility functions
Universal filesystem path utils
Next generation testing framework powered by Vite
An extremely fast JavaScript and CSS bundler and minifier.
Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol
Vite DevTools
A pure JavaScript implementation of Sass.
Modify strings, generate sourcemaps
A comprehensive library for mime-type mapping
A small library to print colourful messages.
A fast and minimal alternative to globby and fast-glob
Message based Two-way remote procedure call
Release history
2 releases in the last two years, typically about 50 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 3.0.2latest | 1 year ago | 21 KB | MIT |
| 3.0.1 | 1 year ago | 21 KB | MIT |
| 3.0.0 | 1 year ago | 21 KB | MIT |
| 2.0.4 | 2 years ago | 20 KB | MIT |
| 2.0.3 | 3 years ago | 20 KB | MIT |
| 2.0.2 | 4 years ago | 29 KB | MIT |
| 2.0.0 | 4 years ago | 20 KB | MIT |
| 1.0.19 | 4 years ago | 20 KB | MIT |
| 1.0.18 | 4 years ago | 20 KB | MIT |
| 1.0.17 | 5 years ago | 20 KB | MIT |
| 1.0.16 | 5 years ago | 20 KB | MIT |
| 1.0.15 | 5 years ago | 20 KB | MIT |
| 1.0.14 | 5 years ago | 20 KB | MIT |
| 1.0.13 | 5 years ago | 20 KB | MIT |
| 1.0.12 | 5 years ago | 21 KB | MIT |
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.