Standard library
zip
Single-entry zip pack and unpack.
Introduction
Single-entry zip pack and unpack. Import std/compress/zip to bind the module as zip. Call free functions as zip.name(...). Struct methods use a receiver value.
/ std/compress/zip
This page is the package reference for std/compress/zip. Private helpers used only by co-located tests are not listed.
Functions
Free functions on zip. Each function has a short description, an example, then parameters and return shape.
pack
Packs a single named entry into a zip archive. Call form: zip.pack(name, data).
/ std/compress/zip
$ z = zip.pack("a.txt", b"hi")Parameters: name: entry name. data: entry bytes. Returns: Zip archive bytes.
unpack_first
Unpacks the first entry from a zip archive. Call form: zip.unpack_first(data).
/ std/compress/zip
$ e = zip.unpack_first(z)
Parameters: data: zip bytes. Returns: Product with name and data for the first entry.