snapzip
v0.2.0
Published
A CLI tool to compress images (.jpg/.jpeg/.png) using Rust, now available on npm!
Readme
Snapzip

snapzip is a fast and efficient image compression tool for JPEG and PNG files, written in Rust for optimal performance.
Features
- Optimized compression for JPEG and PNG images
- Simple command-line interface
- Reports compression statistics (before/after size, percentage saved, execution time)
- High performance thanks to Rust implementation
Installation
npm install -g snapzipUsage
Compressing a JPEG image
snapzip image.jpg compressed.jpgCompressing a PNG image
snapzip image.png compressed.pngExample output
🔧 Compressing image...
✅ Compression completed successfully!
📦 Size before: 1024 KB
📉 Size after: 512 KB
💾 Saved: 50.00%
⏱ Time: 0.25 secondsHow it works
snapzip uses:
- mozjpeg - An optimized JPEG implementation for JPEG image compression
- oxipng - A fast and efficient PNG optimizer for PNG image compression
System requirements
- Node.js: v12.0.0 or higher
- Supported operating systems:
- Windows (x64)
- macOS (Intel x64 and Apple Silicon arm64)
- Linux (x64)
Development
Prerequisites
- Rust (2024 edition or newer)
- Cargo
- Node.js v12.0.0 or higher
- npm
Building from source
Clone the repository
git clone https://github.com/alphajoop/snapzip.git cd snapzipBuild the Rust project
cargo build --releaseInstall npm dependencies
cd pkg npm installSetup binaries for local testing
# From the pkg directory mkdir -p bin # For Windows cp ../target/release/snapzip.exe bin/snapzip-win32-x64.exe # For macOS # cp ../target/release/snapzip bin/snapzip-darwin-x64 # For Linux # cp ../target/release/snapzip bin/snapzip-linux-x64
Publishing
This package uses GitHub Actions to automatically build binaries for all supported platforms and publish to npm.
To publish a new version:
- Make your changes
- Create and push a new version tag:
cd snapzip git tag v0.1.5 # Increment version number git push --tags - GitHub Actions will automatically build binaries for all platforms and publish to npm
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
