Creates the instance
The Reader instance used to read data.
Optionaloptions: ZipReaderConstructorOptions
The options.
OptionalappendedThe data appended after the zip file.
The global comment of the zip file.
Unlike EntryMetaData#comment, it is exposed as raw bytes because the zip format defines no way to record its encoding: section 4.4.26 of the zip specification says nothing about it, and the end of central directory record has neither a general purpose bit flag nor an extra field, so the language encoding flag (see Appendix D - Language Encoding (EFS)) cannot apply to it. Decode it with the encoding agreed with the producer of the zip file.
OptionaldigitalThe data of the digital signature record of the central directory (see ZipWriterCloseOptions#signCentralDirectory), if the zip file contains one.
zip.js does not verify signatures. The signed data is the central directory records, read at ZipReader#directoryOffset, and it never includes the digital signature record itself. Some writers (e.g. SecureZIP) store that record inside ZipReader#directoryLength, so verifying the whole declared range would always fail.
OptionaldirectoryThe length in bytes of the central directory as declared in the end of central directory record. Some
writers (e.g. SecureZIP) include the digital signature record in that length, so subtract
6 + digitalSignature.length from it when the record is stored inside the declared range.
OptionaldirectoryThe offset of the central directory in the zip file.
OptionalprependedThe data prepended before the zip file.
Closes the zip file
It cancels the ReadableStream instance passed to the constructor when nothing has been read
from it, which is the only resource a ZipReader instance can hold. It does nothing otherwise: the
stream is already consumed once ZipReader#getEntries has read the entries into memory, and the
Reader instances are never closed, they belong to the caller. The entries returned by
ZipReader#getEntries can therefore still be read after calling it.
Returns all the entries in the zip file
Optionaloptions: ZipReaderGetEntriesOptions
The options.
A promise resolving to an array of Entry instances.
Returns a generator used to iterate on all the entries in the zip file
Optionaloptions: ZipReaderGetEntriesOptions
The options.
An asynchronous generator of Entry instances.
Represents an instance used to read a zip file.
Example
Here is an example showing how to read the text data of the first entry from a zip file: