sri-sentinel weekly downloads statistics
By MrLouisWright (3 listings) · npm · Webpack plugins
Subresource Integrity (SRI) generator and checker: hashes <script> and <link> resources in built HTML (sha256/384/512, local and CDN), import maps, lazy webpack chunks, writes integrity + crossorigin, fails CI on missing, wrong or stale hashes. JSON manif
sri-sentinel has 8 recorded weekly downloads on npm, a decrease of 50.0% over the past 30 days, ranking #3187 of 3,247 tracked listings.
About sri-sentinel
sri-sentinel
Subresource Integrity (SRI) hashes for your built site: generate them, write them, and fail CI when they're missing, wrong or stale.
sri-sentinel scans the HTML in a built site directory for <script src>, <link rel="stylesheet">, rel="modulepreload", rel="preload" as="script|style", and integrity entries inside <script type="importmap">. It hashes the local files (and, with --remote, CDN files), then either writes integrity attributes (plus crossorigin="anonymous" for cross-origin resources) or checks that the existing ones are correct. Every finding includes a file, line number, severity and a concrete fix.
CLI, library, Vite / webpack / Rollup / esbuild / Astro integrations, and GitHub Action. Node.js 18+, zero runtime dependencies.
Install and run
npx sri-sentinel dist --write # add integrity attributes to dist/**/*.html
npx sri-sentinel dist --check # CI: fail on missing, wrong or stale integrity
npx sri-sentinel dist --write --remote # also fetch and hash CDN resources
npx sri-sentinel dist --manifest sri.json # JSON manifest of resource -> integrity
dist/index.html
4: high <link> "/assets/app.css?v=42" has no integrity attribute [missing-integrity]
↳ Add integrity="sha384-IBXuE+SKr6nOANxq1LIznMbjQUHDJ3PY6mUpF3ZQCTz1+rK8Fip9GAGqRq59yH3C"
5: high <script> "https://cdn.jsdelivr.net/npm/htmx.org@2.0.3/dist/htmx.min.js" has no integrity attribute [missing-integrity]
↳ Run with --remote to fetch and hash it, then --write
6: critical Integrity for "./assets/app.js" does not match its content (wrong or stale) [integrity-mismatch]
↳ Replace with integrity="sha384-Tc1KWaETWL9ZNn+TiVtHwsBd+yyFv2LCslp7PjwHT5aJCyBwpxnW7xtPA1RdtKbo"
7: medium Could not resolve "/assets/vendor.js" (file not found: dist/assets/vendor.js) [unresolved-resource]
↳ Check the path and --base, or allowlist it
1 HTML file(s), 4 resource(s): 1 critical, 2 high, 1 medium
After --write --remote:
<link rel="stylesheet" href="/assets/app.css?v=42" integrity="sha384-IBXuE+SKr6nOANxq1LIznMbjQUHDJ3PY6mUpF3ZQCTz1+rK8Fip9GAGqRq59yH3C">
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.3/dist/htmx.min.js" integrity="sha384-0895/pl2MU10Hqc6jd4RvrthNlDiE9U1tWmX7WRESftEDRosgxNsQG/Ze9YMRzHq" crossorigin="anonymous"></script>
Lazy / runtime chunks (webpack)
The webpack plugin patches the webpack 5 runtime after emit so code-split chunks loaded via import() get an integrity attribute on the injected <script> tag (similar to webpack-subresource-integrity). Top-level scripts in HTML are still updated by the HTML scan.
Set output.crossOriginLoading: 'anonymous' (required for cross-origin SRI). Disable runtime patching with { runtime: false }.
Import maps
For <script type="importmap">, sri-sentinel --write fills the top-level "integrity" object with digests for URLs referenced in imports / scopes:
<script type="importmap">
{
"imports": { "app": "/assets/app.js" },
"integrity": {
"/assets/app.js": "sha384-…"
}
}
</script>
Rules
| Rule | Severity | What it catches |
|---|---|---|
integrity-mismatch | critical | The integrity value doesn't match the file: wrong, or stale after a rebuild |
missing-integrity | high | A script, stylesheet, modulepreload, or import map entry with no integrity |
invalid-integrity | high | Malformed value, wrong digest length or unsupported algorithm (sha1-, md5-) |
missing-crossorigin | high | Cross-origin resource with integrity but no crossorigin. The browser will block it |
unresolved-resource | medium | Local file not found or outside the site root, so it can't be hashed |
fetch-failed | medium | --remote couldn't download the resource (HTTP error, timeout) |
weak-algorithm | low | Valid hash, but weaker than the configured algorithm (e.g. sha256 when sha384 is set) |
remote-unverified | info | Remote resource has integrity, but you didn't pass --remote, so it wasn't verified |
dynamic-resource | info | Templated URL ({{ }}, ${}, <% %>, {% %}) skipped |
Verification works the way browsers do it: only the strongest algorithm in the attribute counts, any hash of that algorithm may match, and base64url and ?options are accepted.
How URLs are resolved
| Reference | Resolved to |
|---|---|
app.js, ./app.js, ../assets/app.js | Relative to the HTML file |
/assets/app.js | Site root (the directory you scan). With --base /app/, /app/assets/app.js maps to assets/app.js |
https://example.com/assets/app.js | Local if --origin https://example.com is set, otherwise remote (cross-origin) |
//cdn.example.com/x.js | Remote, over https |
app.js?v=3#x | The query string and fragment are ignored for file lookup and kept in the HTML |
data:, blob:, inline <script> | Ignored |
| Paths escaping the site root | unresolved-resource, never read |
Add data-sri-ignore to a tag to skip it.
Options…
Description from the npm listing.
- sri
- subresource-integrity
- integrity
- security
- cdn
- supply-chain-security
- hash
- sha384
- html
- importmap
- vite-plugin
- webpack-plugin
- rollup-plugin
- esbuild-plugin
- astro-integration
- sarif
- cli
- github-action
- devsecops
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (142)Similar npm Webpack plugins plugins
All 20 sri-sentinel alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/sri-sentinel. First seen Nov 11, 2026; last successful collection Nov 24, 2026. See the methodology.