← All Modules

tar

Tar archive creation, extraction, and listing. Supports plain tar and gzip-compressed archives. No require() needed — available as a global builtin.

Functions

Example:

-- Create a tar.gz archive
tar.create("bundle.tar.gz", {
  ["app/main.lua"] = [[print("hello")]],
  ["config.toml"] = '[server]\nport = 8080\n',
}, {gzip = true})

-- Extract
tar.extract("bundle.tar.gz", "/tmp/extracted")

-- List contents
local paths = tar.list("bundle.tar.gz")
-- → {"app/main.lua", "config.toml"}