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

https://github.com/essentialkaos/npck

Go package for unpacking various types of archives
https://github.com/essentialkaos/npck

golang-package gzip lz4 zip zstandard

Last synced: about 2 months ago
JSON representation

Go package for unpacking various types of archives

Awesome Lists containing this project

README

          



Codacy
Coverage Status
GitHub Actions CI Status
GitHub Actions CodeQL Status

Supported formatsUsage exampleCI StatusLicense


`npck` is a Go package for unpacking various types of archives.

### Supported formats

* [tar](https://en.wikipedia.org/wiki/Tar_(computing)) (`.tar`)
* [Gzip](https://www.gnu.org/software/gzip/) (`.gz`, `.tgz`, `.tar.gz`)
* [bzip2](http://sourceware.org/bzip2/) (`.bz2`, `.tbz2`, `.tar.bz2`)
* [xz](https://tukaani.org/xz/) (`.xz`, `.txz`, `.tar.xz`)
* [Zstandart](https://facebook.github.io/zstd/) (`.zst`, `.tzst`, `.tar.zst`)
* [LZ4](https://lz4.github.io/lz4/) (`.lz4`, `.tlz4`, `.tar.lz4`)
* [ZIP](https://en.wikipedia.org/wiki/ZIP_(file_format)) (`.zip`)

### Usage example

```go
package main

import (
"fmt"
"github.com/essentialkaos/npck/v2"
)

func main() {
file := "file.tar.gz"
err := npck.Unpack(file, "/home/john")

if err != nil {
fmt.Printf("Error: Can't unpack %s: %v\n", file, err)
return
}

fmt.Printf("File %s successfully unpacked!\n", file)
}
```

### CI Status

| Branch | Status |
|--------|--------|
| `master` | [![CI](https://github.com/essentialkaos/npck/actions/workflows/ci.yml/badge.svg?branch=master)](https://kaos.sh/w/npck/ci?query=branch:master) |
| `develop` | [![CI](https://github.com/essentialkaos/npck/actions/workflows/ci.yml/badge.svg?branch=develop)](https://kaos.sh/w/npck/ci?query=branch:develop) |

### Contributing

Before contributing to this project please read our [Contributing Guidelines](https://github.com/essentialkaos/.github/blob/master/CONTRIBUTING.md).

### License

[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)