function collectStream
Since 0.1.0
collectStream(response: Response): Promise<StreamingBody>

Collects a web Response body incrementally via a ReadableStream reader.

Reads each chunk into chunks, decodes the concatenation into text with TextDecoder. Throws if response.body is null.

Parameters

response: Response

A streaming web Response

Return Type

Promise<StreamingBody>

The collected chunks and decoded text

Throws

Error

If response.body is null

Usage

import { collectStream } from "testing/src/index.ts";