🛠️ Utilities and Scripts
The project includes a collection of standalone scripts and tools designed to automate repetitive tasks and manage content.
🖼️ Batch Image Optimizer
When uploading hundreds of product photos or article banners, using raw and heavy images (like large JPG/PNGs) severely slows down the store's load speed. To solve this, a Node.js script using the sharp library is provided in the image-optimizer/ folder.
What does this tool do?
- Scans the
input/folder for jpg, jpeg, and png files. - Resizes images if necessary (maximum width: 1200 pixels) to avoid unnecessary resolutions.
- Converts images to the modern and highly compressed WebP format (with 80 quality).
- Saves the final output in the
output/folder.
How to use:
1. First, enter the tool's folder:
cd image-optimizer2. Install the packages (only for the first time):
npm install3. Copy your raw and heavy photos into the input/ folder.
4. Run the optimizer script:
npm start5. Now you can grab your optimized WebP images from the output/ folder and upload them in the Strapi or Medusa panel!