Caelus3,462 checksGitHubv0.25.0MIT
API Reference / fetchPacks · function

Function: fetchPacks()

function fetchPacks(
   manifest, 
   entries, 
   fetchPack, 
options?): Promise<LoadedPack[]>;

Fetch, verify, and decode packs. Resolves with the packs in the order given. Rejects with PackIntegrityError if any pack's length or SHA-256 differs from its manifest entry; a pack that fails is never decoded.

Only the entries passed are fetched, and each must be one the manifest lists, so a caller cannot be steered into fetching an arbitrary file.

Parameters

ParameterType
manifestPackManifest
entriesreadonly PackManifestEntry[]
fetchPackPackFetch
optionsLoadPacksOptions

Returns

Promise<LoadedPack[]>

Start building

Quickstart →