Image-Script is a straightforward Node.js command-line tool that enables batch image compression via TinyPNG API and format conversion for images in a folder. It automates repetitive image optimization tasks to streamline development workflows.
- ๐ Batch processing of images in
./targetfolder - ๐๏ธ High-quality compression through TinyPNG API
- ๐ Format conversion support (JPEG/PNG/WebP)
- ๐งน Automatic skip of non-image files
- ๐ Auto-creation of
./Compressedand./Convertedoutput folders
git clone https://github.com/Thinkteam20/Image-Script.git
cd Image-Script
npm install# Create .env file with your TinyPNG API key
echo "API_KEY=your_tinypng_api_key" > .env- Place images to compress or convert in the
./targetfolder - Supported formats:
.jpg,.jpeg,.png,.webp
node index.js- Choose
1: Image compression (maintains original format) - Choose
2: Format conversion (select PNG, WebP, or JPEG)
- Compressed files:
./Compressed/ - Converted files:
./Converted/
Built to automate repetitive image optimization tasks encountered during web development projects. A simple yet practical CLI tool that has been used across 20+ real projects.
- Node.js (fs, path, readline modules)
- TinyPNG API (
tinifypackage) - dotenv (API key management)
- Duplicate filename handling
- Recursive subfolder processing
- Progress indicator display
- User configuration options (quality settings)
Made to save time, not to be fancy. A small tool that reduces repetitive work.