A universal Subresource Integrity (SRI) utility for Node.js, browsers, Cloudflare Workers, Deno, Bun, and other web-compatible runtimes.
  • TypeScript 100%
Find a file
2026-05-14 10:39:18 +09:00
.changes 1.1.1 2026-05-13 06:23:59 +00:00
.github/workflows Set GH_TOKEN env for release workflow 2026-05-12 21:19:58 +09:00
runtime Delegate compiler options to the external @tsconfig/bun package 2026-05-12 20:45:39 +09:00
src Build pure ESM with tsc 2026-05-12 20:38:16 +09:00
test Update tests to assert expected output structure for IntegrityMetadataSet 2025-02-19 17:19:45 +09:00
.changie.yaml Migrate release workflow from release-it to changie 2026-05-12 18:02:43 +09:00
.gitignore create subresourceintegrity 2024-09-03 03:14:59 +09:00
CHANGELOG.md 1.1.1 2026-05-13 06:23:59 +00:00
package-lock.json 1.1.1 2026-05-13 06:23:59 +00:00
package.json Remove redundant types field from package.json 2026-05-14 10:39:18 +09:00
README.md Reorder package manager installation examples 2026-04-30 11:01:52 +09:00
renovate.json Enable grouping and npmDedupe in Renovate 2026-04-02 16:41:27 +09:00
tsconfig.json Build pure ESM with tsc 2026-05-12 20:38:16 +09:00

websri

NPM Version jsDocs.io

websri is a universal Subresource Integrity (SRI) utility for Node.js, browsers, Cloudflare Workers, Deno, Bun, and other web-compatible runtimes.

Usage

Install package:

# npm
npm install websri

# pnpm
pnpm add websri

# yarn
yarn add websri

# bun
bun add websri

# deno
deno add npm:websri

Integrity Metadata:

import { createIntegrityMetadata } from "websri";

const res = new Response("Hello, world!");
const data = await res.arrayBuffer();
const integrityMetadata = await createIntegrityMetadata("sha256", data);

console.log(integrityMetadata.toString());
// sha256-MV9b23bQeMQ7isAGTkoBZGErH853yGk0W/yUx1iU7dM=

Documentation

API Reference

FAQ

What is Subresource Integrity?

Subresource Integrity (SRI) is a security feature that allows user agents to verify that a fetched resource has not been manipulated unexpectedly.

License

websri is released under the MIT License.