https://github.com/c4milo/unpackit
Go package to natively decompress and unarchive tar.gz, tar.bzip2, tar.xz, zip and tar files.
https://github.com/c4milo/unpackit
bzip2 decompression-library go golang gzip tar unpack xz zip
Last synced: about 1 year ago
JSON representation
Go package to natively decompress and unarchive tar.gz, tar.bzip2, tar.xz, zip and tar files.
- Host: GitHub
- URL: https://github.com/c4milo/unpackit
- Owner: c4milo
- License: mpl-2.0
- Created: 2014-09-03T19:10:46.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-10-04T15:55:30.000Z (over 3 years ago)
- Last Synced: 2025-03-30T06:08:42.668Z (about 1 year ago)
- Topics: bzip2, decompression-library, go, golang, gzip, tar, unpack, xz, zip
- Language: Go
- Homepage:
- Size: 3.13 MB
- Stars: 82
- Watchers: 9
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# UnpackIt
[](https://godoc.org/github.com/c4milo/unpackit)
[](https://travis-ci.org/c4milo/unpackit)
This Go library allows you to easily unpack the following files using magic numbers:
* tar.gz
* tar.bzip2
* tar.xz
* zip
* tar
## Usage
Unpack a file:
```go
file, _ := os.Open(test.filepath)
err := unpackit.Unpack(file, tempDir)
```
Unpack a stream (such as a http.Response):
```go
res, err := http.Get(url)
err := unpackit.Unpack(res.Body, tempDir)
```