shrink-img
Installation
npm install shrink-img
Usage
const shrink = ; // Pass in a directory. It will recursively compress all png,jpg,gif images under this folder. // !! This will replace your original images, do back up if you needed. ; ;
You need to have a tinyPng API key before compress images. Go to apply: https://tinypng.com/developers