Module

x/proc/tests/deps/streams.ts>toBlob

A better way to work with processes in Deno.
Latest
function toBlob
import { toBlob } from "https://dotland.deno.dev/x/proc@0.21.9/tests/deps/streams.ts";

Converts a ReadableStream of {@link Uint8Array}s to a Blob. Works the same as {@link Response.blob}.

Examples

Example 1

import { toBlob } from "https://deno.land/std@$STD_VERSION/streams/to_blob.ts";

const stream = ReadableStream.from([new Uint8Array(1), new Uint8Array(2)]);
await toBlob(stream); // Blob { size: 3, type: "" }

Parameters

stream: ReadableStream<Uint8Array>

Returns

Promise<Blob>