Options
All
  • Public
  • Public/Protected
  • All
Menu

An uninitialised pointer to a remote ZIP file.

No network requests are sent until populate() is called.

const url = new URL("http://www.example.com/test.zip");
const remoteZip = await new RemoteZipPointer({ url }).populate();
const fileListing = remoteZip.files(); // RemoteZipFile[]
const uncompressedBytes = await remoteZip.fetch("test.txt"); // ArrayBuffer

Hierarchy

  • RemoteZipPointer

Index

Constructors

  • new RemoteZipPointer(__namedParameters: { additionalHeaders?: Headers; credentials?: "include" | "omit" | "same-origin"; headUrl?: URL; method?: string; url: URL }): RemoteZipPointer
  • Parameters

    • __namedParameters: { additionalHeaders?: Headers; credentials?: "include" | "omit" | "same-origin"; headUrl?: URL; method?: string; url: URL }
      • Optional additionalHeaders?: Headers

        Passed to fetch when performing a HTTP GET request for the file

      • Optional credentials?: "include" | "omit" | "same-origin"

        Passed to fetch when performing a HTTP GET request for the file

      • Optional headUrl?: URL

        URL for HEAD request. Defaults to url. This can, for example, differ from url if you are using a signed URL for S3.

      • Optional method?: string

        Passed to fetch when performing a HTTP GET request for the file

      • url: URL

        URL for GET requests

    Returns RemoteZipPointer

Properties

additionalHeaders?: Headers

Additional headers, if any, passed to fetch when calling url or headUrl

credentials: "include" | "omit" | "same-origin"

Credentials passed to fetch when retrieving files. Defaults to same-origin.

headUrl: URL

URL used when performing the HTTP HEAD request to fetch ZIP metadata

method: string

HTTP method used to fetch ZIP metadata (the initial HEAD request is always sent)

url: URL

URL of the remote ZIP archive

Methods

  • Gets metadata about the ZIP file and constructs an initialised RemoteZip.

    throws

    RemoteZipError if it fails to parse or fetch

    Returns Promise<RemoteZip>

    An initialised RemoteZip

Generated using TypeDoc