https://github.com/groundbreaker/zippity
Creates Zip Files, quickly.
https://github.com/groundbreaker/zippity
go golang lib zipfiles
Last synced: 8 months ago
JSON representation
Creates Zip Files, quickly.
- Host: GitHub
- URL: https://github.com/groundbreaker/zippity
- Owner: groundbreaker
- License: mit
- Created: 2020-01-23T17:12:32.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-23T19:14:47.000Z (over 6 years ago)
- Last Synced: 2025-10-27T23:39:14.969Z (8 months ago)
- Topics: go, golang, lib, zipfiles
- Language: Go
- Size: 1.38 MB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :suspension_railway: zippity
[](https://godoc.org/github.com/groundbreaker/zippity)
Creates Zip Files, quickly.
---
## Install
go get github.com/groundbreaker/zippity
## Usage
```go
import (
"fmt"
"github.com/groundbreaker/zippity"
)
func main() {
// Read a file
pdf := zippity.ReadFile("test.pdf", "fine.pdf")
// Or create one from a []byte
txt := &zippity.File{
Name: "test.txt",
Body: []byte("Already have the bytes? Then, create a literal File."),
}
// Create a new Zipfile
zf := zippity.New()
// Chain as many Add
zf.Add(pdf).Add(txt)
zip := zf.Done() // returns the Zipfile as []byte
// or you can save it to disk with:
// zf.Save("path/to/write/file.zip")
fmt.Printf("zip is %d bytes", len(zip))
}
```