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
function
stream.consumers.blob
stream: ReadableStream | AsyncIterable<any, any, any> | ReadableStream<any>
): Promise<Blob>;
@returns
Fulfills with a Blob containing the full contents of the stream.
Referenced types
interface ReadableStream<R = any>
- ): ReadableStream<T>;
interface Blob
Consume the blob as an ArrayBuffer
Consume as a Uint8Array, backed by an ArrayBuffer
Returns a readable stream of the blob's contents

