An open API service indexing awesome lists of open source software.

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.

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")
}
```