function toBlob
toBlob(stream: ReadableStream<Uint8Array>): Promise<Blob>Converts a ReadableStream of Uint8Arrays to a
Blob. Works the same as Response.blob.
Examples
Example 1
Example 1
import { toBlob } from "@std/streams/to_blob"; const stream = ReadableStream.from([new Uint8Array(1), new Uint8Array(2)]); await toBlob(stream); // Blob { size: 3, type: "" }
Parameters
stream: ReadableStream<Uint8Array>