fetchBytes
function fetchBytes(url: string, options?: GuardedFetchOptions): Promise<Uint8Array<ArrayBufferLike>>;Binary twin of fetchPage: same guard, User-Agent, deadline, and streamed size cap, but returns the raw bytes — for document downloads (PDFs, images, audio) where decoding to text would corrupt the payload.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url | string | The address to fetch. |
options | GuardedFetchOptions | Cap, headers, fetch, and timeout overrides. |
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
The body bytes, exactly as received.