### Install websri using npm, yarn, pnpm, deno, or bun Source: https://github.com/kou029w/websri/blob/main/README.md Demonstrates how to install the websri package using common JavaScript package managers and runtime add commands. This is the first step to using the library in your project. ```sh # npm npm install websri ``` ```sh # yarn yarn add websri ``` ```sh # pnpm pnpm add websri ``` ```sh # deno denio add npm:websri ``` ```sh # bun bun add websri ``` -------------------------------- ### Create Integrity Metadata with websri in TypeScript Source: https://github.com/kou029w/websri/blob/main/README.md Shows how to use the `createIntegrityMetadata` function from the websri library to generate a Subresource Integrity (SRI) hash string. It takes a hash algorithm name and the resource data as input and returns the SRI metadata. ```ts 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= ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.