Gzipper is a versatile command-line interface (CLI) tool and Node.js module designed for efficient file compression. It supports a comprehensive range of modern compression algorithms, including Deflate, Brotli, gzip, Zopfli, and zstd, providing developers with extensive control over the compression process. The current stable version is 8.2.1, with a regular release cadence as features and fixes are developed. Its key differentiators include fine-grained control over algorithm-specific parameters (e.g., `--gzip-level`, `--brotli-quality`), support for incremental compression, verbose output, and seamless integration with popular CLI UI tools like Angular CLI. It can compress entire directories by default or be configured with include/exclude patterns, and allows for custom output file formats. Environment variables take precedence over CLI arguments for configuration.
npm install gzipperVerified import paths — ran on the pinned version, not inferred.
Demonstrates programmatic usage of `gzipper` to compress a dummy file within a temporary directory using both Brotli and Gzip algorithms, with verbose output and cleanup.
Upgrade your Node.js environment to version 20.11.0 or newer (e.g., using nvm or your package manager).
Always use the `--include <extensions>` (e.g., `--include js,css,html`) or `--exclude <extensions>` options to specify exactly which file types should be compressed, especially when working with entire project output directories.
Be aware of your environment variables if CLI arguments or programmatic options seem to be ignored. Explicitly unset relevant `GZIPPER_` prefixed environment variables if you want CLI/code arguments to take precedence.
Define distinct output file formats for each algorithm, such as `[name].[ext].gz` for Gzip and `[name].[ext].br` for Brotli, to avoid accidental overwrites. The `compress` function also accepts `gzipOutputFileNameFormat` and `brotliOutputFileNameFormat` options.
Install `gzipper` globally using `npm i -g gzipper` or ensure your shell's PATH includes `$(npm bin -g)`.
Either convert your consuming script to an ES Module (e.g., add `"type": "module"` to package.json or use `.mjs` extension) and use `import { compress } from 'gzipper';`, or ensure you are using the CommonJS compatible entry point with `const { compress } = require('gzipper/cjs');` if available, or simply `require('gzipper');` which should resolve correctly based on the package.json `exports` field.Ensure that the input path and output path arguments are correctly provided as strings to the `compress` function or CLI command.
No dependency data recorded yet.