https://github.com/silverwind/precompress
CLI to compress files to gzip and brotli
https://github.com/silverwind/precompress
brotli cli gzip httpd nginx precompress static-site
Last synced: 7 days ago
JSON representation
CLI to compress files to gzip and brotli
- Host: GitHub
- URL: https://github.com/silverwind/precompress
- Owner: silverwind
- License: bsd-2-clause
- Created: 2018-08-05T13:31:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T18:45:13.000Z (2 months ago)
- Last Synced: 2025-04-15T22:53:40.985Z (7 days ago)
- Topics: brotli, cli, gzip, httpd, nginx, precompress, static-site
- Language: JavaScript
- Homepage:
- Size: 1.74 MB
- Stars: 28
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.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 and brotli. 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
-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 versionExamples:
$ precompress ./build
```© [silverwind](https://github.com/silverwind), distributed under BSD licence