Luau Bindings — packer
The
require("packer")script API — read and write archives. It handles ZIP today; it's named for the job, not the format, so other archive/compression formats can slot in behind the same calls later. Every function is[antos]. Design & native core: antos_packer.
local packer = require("packer")
packer.pack("D:/backup.zip", "D:/notes") -- format from the extension
for _, e in ipairs(packer.list("D:/backup.zip")) do print(e.name, e.size) end
local text = packer.read("D:/backup.zip", "notes/todo.txt")
| Function | Behaviour |
|---|---|
packer.pack(archive, src [, opts]) |
Create/append an archive from a file or folder. Format from the archive's extension (or opts.format). |
packer.unpack(archive, dest) |
Extract an archive to a folder. |
packer.unpackFile(archive, name, dest) |
Extract a single entry. |
packer.list(archive) |
Entries → { { name, size, csize, … }, … }. |
packer.info(archive) |
Archive summary (count, sizes, comment). |
packer.read(archive, name) |
Read one entry's bytes without extracting to disk. |
ZIP today, format-agnostic by name.
zipis a specific format;packeris the job. Keeping the library format-neutral means tar/gzip/others can join behind the samepack/unpack/listsurface without a new library or new API.
Paths are drive-letter paths, so archives and their contents live on any volume — bundle from D:, read a .zip off a B: cartridge, extract to DBFS.
Related
- antos_packer — design & native core · luau_fs · luau_io · AntOS Libraries hub