function readTextCapped
readTextCapped(
res: Response,
maxBytes?
): Promise<string>

Reads the body of res as text, up to maxBytes, in the charset the page declares; the rest is cancelled, never downloaded. fetchPage and the Bandcamp and YouTube resolvers read pages through it.

Parameters

optional
maxBytes = MAX_PAGE_BYTES

Return Type

Promise<string>

Usage

import { readTextCapped } from "api/remote/fetch.ts";