DocsDeveloper SectionDeveloper Utilities

🛠️ 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?

  1. Scans the input/ folder for jpg, jpeg, and png files.
  2. Resizes images if necessary (maximum width: 1200 pixels) to avoid unnecessary resolutions.
  3. Converts images to the modern and highly compressed WebP format (with 80 quality).
  4. Saves the final output in the output/ folder.

How to use:

1. First, enter the tool's folder:

cd image-optimizer

2. Install the packages (only for the first time):

npm install

3. Copy your raw and heavy photos into the input/ folder.

4. Run the optimizer script:

npm start

5. Now you can grab your optimized WebP images from the output/ folder and upload them in the Strapi or Medusa panel!