| Crates.io | webcomp |
| lib.rs | webcomp |
| version | 1.0.0 |
| created_at | 2025-01-13 07:55:27.315718+00 |
| updated_at | 2025-01-13 07:55:27.315718+00 |
| description | webcomp (WEB COMPressor) is a command-line tool that compresses files into multiple formats, including Brotli, Compress (LZW), Deflate, Gzip, and Zstandard. It helps generate pre-compressed files for hosting on web servers to reduce data traffic. |
| homepage | https://github.com/koma-private/webcomp |
| repository | https://github.com/koma-private/webcomp |
| max_upload_size | |
| id | 1514355 |
| size | 327,769 |
webcomp (WEB COMPressor) is a command-line tool that compresses files into multiple formats, including Brotli, Compress (LZW), Deflate, Gzip, and Zstandard. It generates pre-compressed files for hosting on web servers, reducing bandwidth usage and improving performance.

Multi-Format Compression: Supports Brotli, Compress (LZW), Deflate, Gzip, and Zstandard.
Efficiency-Oriented: Automatically skips files if compression results in larger sizes.
Dry Run Mode: Preview compression or cleaning operations without making changes.
Detailed Reports: Provides a summary of compressed, errored, and skipped files.
Multi-Threaded: Parallel processing for faster compression.
Broad File Support: Handles a wide range of file types including CSS, HTML, JSON, and more.
Cross-Platform Builds: Binaries for Windows, macOS, and Linux.
webcomp processes files based on their extensions only. Supported extensions include:
webcomp will not generate a compressed file if the compressed file's size is larger than the original file. This
behavior ensures that unnecessary larger files are not created.webcomp also supports a "Dry Run Mode," allowing users to preview which files will be compressed or deleted without
performing the actual operation. To enable this mode, pass --dry-run as a command-line option.webcomp generates a detailed report after compression or cleaning operations. The report includes:
Compressing dummy-static-website

webcomp [options]
| Short Option | Long Option | Value | description |
|---|---|---|---|
| -p | --path | <PATH> |
Specify one or more paths to compress. |
| -b | --brotli | Enable Brotli compression. | |
| --clean | Remove existing compressed files. | ||
| -c | --compress | Enable Compress (LZW) compression. | |
| --compress-min-code-size | <COMPRESS_MIN_CODE_SIZE> |
Minimum code size for LZW compression. Must be 8 or greater. Default: 8 |
|
| -d | --deflate | Enable Deflate compression. | |
| --dry_run | Enable dry run mode. Show what would be compressed and its estimated size reduction without actually compressing. | ||
| -g | --gzip | Enable Gzip compression. | |
| --max-threads | <MAX_THREADS> |
Maximum threads for parallel processing. Default: 10 |
|
| -V | --version | Display version information and exit. | |
| -z | --zstd | Enable Zstandard compression. | |
| --zstd-level | <ZSTD_LEVEL> |
Set Zstandard compression level (range: 1-22). Default: 10 |
|
| -h | --help | Display help information. | |
| -h | --dry-run | Perform a dry run without making changes (for compression or cleaning). |
webcomp --version
webcomp -p ./public -p ./dist --brotli --deflate
webcomp -p ./public -p ./dist --brotli --dry-run
webcomp -p ./assets --brotli --gzip --zstd --zstd-level 15
webcomp --clean -p ./public -p ./dist
webcomp --clean --dry-run -p ./public -p ./dist
stable-x86_64-pc-windows-msvcbuild-win.cmd
target-win/releasexcode-select --install
rustup target add x86_64-apple-darwin aarch64-apple-darwin
./build-mac.sh
dist-mac./build-linux.sh
target-docker/releasewebcomp relies on the following open-source projects:
webcomp is licensed under the MIT license.