Skip to content

Go package for unpacking various types of archives

License

Notifications You must be signed in to change notification settings

essentialkaos/npck

Code Climate Maintainability 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 (.tar)
  • Gzip (.gz, .tgz, .tar.gz)
  • bzip2 (.bz2, .tbz2, .tar.bz2)
  • xz (.xz, .txz, .tar.xz)
  • Zstandart (.zst, .tzst, .tar.zst)
  • LZ4 (.lz4, .tlz4, .tar.lz4)
  • ZIP (.zip)

Usage example

package main

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

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
develop CI

License

Apache License, Version 2.0