zlib

module
v0.0.0-...-20d48d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2022 License: MIT

README

zlib

I couldn't find a command-line tool for decompressing and compressing zlib data, so I wrote my own. That's about the long and short of it.

Update: @stokito noted that pigz exists and can do zlib compression with pigz -z. Nice!

Installation

Download a release or install the latest directly using Go:

go install github.com/kevin-cantwell/zlib/cmd/zlib@latest

For older versions of Go, try: go get -u github.com/kevin-cantwell/zlib/cmd/zlib

Usage

Without any arguments, zlib will compress an input stream. Use the -d flag for decompression.

NAME:
   zlib - A wrapper for the zlib compression algorithm.

USAGE:
   zlib [global options] command [command options] [arguments...]

VERSION:
   0.0.0

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   -d, --decompress Decompresses the input instead of compressing the output.
   --help, -h       show help
   --version, -v    print the version

Examples

Compressing a file
zlib < file > file.zlib
Decompressing a zlib-compressed file
zlib -d < file.zlib
Compressing and base64-encoding some json
echo -n '{"foo":"bar"}' | zlib | base64

Outputs: eJyqVkrLz1eyUkpKLFKqBQQAAP//HXoENA==

Decoding and decompressing some base64-encoded and zlib-compressed input
echo -n 'eJyqVkrLz1eyUkpKLFKqBQQAAP//HXoENA==' | base64 -D | zlib -d

Outputs: {"foo":"bar"}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL