https://github.com/silverwind/precompress
CLI to compress files to gzip, brotli, zst
https://github.com/silverwind/precompress
brotli cli gzip httpd nginx precompress static-site
Last synced: 14 days ago
JSON representation
CLI to compress files to gzip, brotli, zst
- Host: GitHub
- URL: https://github.com/silverwind/precompress
- Owner: silverwind
- License: bsd-2-clause
- Created: 2018-08-05T13:31:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2026-03-09T22:13:57.000Z (18 days ago)
- Last Synced: 2026-03-10T04:37:20.686Z (18 days ago)
- Topics: brotli, cli, gzip, httpd, nginx, precompress, static-site
- Language: JavaScript
- Homepage:
- Size: 1.52 MB
- Stars: 29
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# precompress
[](https://www.npmjs.org/package/precompress) [](https://www.npmjs.org/package/precompress) [](https://packagephobia.com/result?p=precompress)
CLI to compress files to gzip, brotli and zstd. Files are efficiently compressed in parallel. Existing output files will always be overridden.
## Usage
```bash
# compress all files in the "build" directory using node
npx precompress ./build
# same with bun
bunx precompress ./build
```
## Options
```
usage: precompress [options]
Options:
-t, --types Types of files to generate. Default: gz,br,zst
-i, --include Only include given globs. Default: unset
-e, --exclude Exclude given globs. Default: **.gz,**.br
-m, --mtime Skip creating existing files when source file is newer
-f, --follow Follow symbolic links
-d, --delete Delete source file after compression
-o, --outdir Output directory, will preserve relative path structure
-b, --basedir Base directory to derive output path, use with --outdir
-E, --extensionless Do not output a extension, use with single --type and --outdir
-s, --silent Do not print anything
-S, --sensitive Treat include and exclude patterns case-sensitively
-c, --concurrency Number of concurrent operations. Default: auto
-V, --verbose Print individual file compression times
-h, --help Show this text
-v, --version Show the version
Examples:
$ precompress ./build
```
© [silverwind](https://github.com/silverwind), distributed under BSD licence