Zip:constructor(file, [mode], [level])constructor

The Zip constructor opens the specified ZIP archive using the specified mode. Returns a Zip value representing the ZIP archive.

Parameters

file

A string or a File object, representing the ZIP archive to be opened.

[mode]

An optional string that indicate the open mode :
  • "read" : The zip archive is open for reading (the zip archive must exist). It's the default mode.
  • "append" : The zip archive is open for appending (the zip archive must exist).
  • "write" : The zip archive is open for writing (the zip archive is created and overwrites any previous existing archive).
  • "delete" : The zip archive is open for deleting (Zip.delete() can be used to delete entries).

[level]

An optional number that indicate the compression level, from 0 (no compression) to 10 (maximum compression level), defaulting to 6.

Return value

The constructor returns a new Zip instance.

Example

{{example}}