Fblob
Bun

function

stream.consumers.blob

function blob(
stream: ReadableStream | AsyncIterable<any, any, any> | ReadableStream<any>
): Promise<Blob>;
import { blob } from 'node:stream/consumers';

const dataBlob = new Blob(['hello world from consumers!']);

const readable = dataBlob.stream();
const data = await blob(readable);
console.log(`from readable: ${data.size}`);
// Prints: from readable: 27
@returns

Fulfills with a Blob containing the full contents of the stream.

Referenced types

interface ReadableStream<R = any>

interface Blob