Chevron Down
Table of Contents
Chevron DownAPI Reference

ZipLoader

Decodes a Zip Archive into a file map.

LoaderCharacteristic
File Extension.zip
File TypeBinary
File FormatZIP Archive
Data Format"File Map"
Decoder TypeAsynchronous
Worker ThreadNo
StreamingNo

Usage

import {parse} from '@loaders.gl/core';
import {ZipLoader} from '@loaders.gl/zip';

const fileMap = await parse(arrayBuffer, ZipLoader);
for (const fileName in FILE_MAP) {
  const fileData = fileMap[key];
  // Do something with the subfile
}

Data Format

The file map is an object with keys representing file names or relative paths in the zip file, and values being the contents of each sub file (either ArrayBuffer or String).

Options

Options are forwarded to JSZip.loadAsync.