https://github.com/yybit/nu_plugin_compress
A nushell plugin for compression and decompression, supporting zstd, gzip, bzip2, and xz.
https://github.com/yybit/nu_plugin_compress
Last synced: 6 days ago
JSON representation
A nushell plugin for compression and decompression, supporting zstd, gzip, bzip2, and xz.
- Host: GitHub
- URL: https://github.com/yybit/nu_plugin_compress
- Owner: yybit
- License: apache-2.0
- Created: 2024-09-21T06:33:02.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-04-02T13:56:24.000Z (12 days ago)
- Last Synced: 2025-04-02T14:03:20.740Z (12 days ago)
- Language: Rust
- Size: 27.3 KB
- Stars: 23
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nu - nu_plugin_compress
README
[](https://crates.io/crates/nu_plugin_compress)
[](https://docs.rs/nu_plugin_compress)## nu_plugin_compress
A nushell plugin for compression and decompression, supporting zstd, gzip, bzip2, and xz.
## StatusSupported compression formats include:
|Type|Compress Command|Decompress Command|
|--|--|--|
|gzip|to gz|from gz|
|zstd|to zst|from zst|
|xz|to xz|from xz|
|bzip2|to bz2|from bz2|### Installation
```shell
cargo install nu_plugin_compress
plugin add ~/.cargo/bin/nu_plugin_compress
plugin use compress
```### Usage
```shell
# compress and save
"hello" | to gz | save hello.gz
# compress with level 7, Default level is 3
"hello" | to xz -l 7
# decompress and print
open hello.gz | decode
# archive and compress
tar cvf - hello.txt | to gz | save hello.tar.gz
# decompress and unarchive
open hello.tar.gz | tar xvf -
```### Example
```shell
> open hello.gz
Length: unknown (stream) | printable whitespace ascii_other non_ascii
00000000: 68 65 6c 6c 6f hello
```