https://github.com/jackmordaunt/zip
Simple utility for creating and extracting zip archives with a pluggable filesystem backend.
https://github.com/jackmordaunt/zip
go golang utility zip
Last synced: 9 months ago
JSON representation
Simple utility for creating and extracting zip archives with a pluggable filesystem backend.
- Host: GitHub
- URL: https://github.com/jackmordaunt/zip
- Owner: JackMordaunt
- License: mit
- Created: 2018-01-25T13:42:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-12T13:38:46.000Z (over 8 years ago)
- Last Synced: 2025-02-25T09:23:35.323Z (over 1 year ago)
- Topics: go, golang, utility, zip
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# zip
> Simple zip utility with a pluggable filesystem backend.
`go get github.com/jackmordaunt/zip`
The filesystem defaults to `afero.OsFs`, which operates on the host OS native
filesystem.
Example use:
```go
func main() {
_ = zip.Create("path/to/archive.zip", "path/to/source")
_ = zip.Extract("path/to/achive.zip", "path/to/dest")
}
```
To set the filesystem backend:
```go
func main() {
filesystem := afero.NewMemMapFs()
zip.SetFs(filesystem)
_ = zip.Create("path/to/archive.zip", "path/to/source")
_ = zip.Extract("path/to/achive.zip", "path/to/dest")
}
```