https://github.com/lde-org/archive
A cross-platform archive reading and writing library for LuaJIT.
https://github.com/lde-org/archive
archive lde lua luajit tar zip
Last synced: 22 days ago
JSON representation
A cross-platform archive reading and writing library for LuaJIT.
- Host: GitHub
- URL: https://github.com/lde-org/archive
- Owner: lde-org
- License: mit
- Created: 2026-04-19T02:06:21.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-04-28T07:52:28.000Z (about 2 months ago)
- Last Synced: 2026-04-28T09:29:21.702Z (about 2 months ago)
- Topics: archive, lde, lua, luajit, tar, zip
- Language: Lua
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# archive
This is a cross platform library to create, modify and extract archive files.
## Usage
```
lde add archive --git https://github.com/lde-org/archive
```
## Examples
**Extract a ZIP or TAR archive:**
```lua
local Archive = require("archive")
local ok, err = Archive.new("path/to/file.zip"):extract("output/dir")
if not ok then error(err) end
-- Strip the top-level directory (e.g. "repo-main/src" → "src")
Archive.new("file.tar.gz"):extract("output/dir", { stripComponents = true })
```
**Create and save an archive:**
```lua
local Archive = require("archive")
local files = {
["hello.txt"] = "Hello, world!",
["src/init.lua"] = "return {}",
}
-- Format is inferred from the extension: .zip, .tar, or .tar.gz
local ok, err = Archive.new(files):save("output.zip")
if not ok then error(err) end
Archive.new(files):save("output.tar.gz")
```