Image batch compression script written using TinyPNG API.
-
Go to tinypng.com to apply for API-Key
-
Fill in the API-Key into /index.js
// index.js Line 30 tinify.key = "Your TinyPNG API-KEY";
-
Use
yarn install
to install dependency packages -
Place the images that need to be compressed and built in the
/entry
directory, which supports folders -
Run the command
yarn build
ornode index.js
-
Wait for the execution to complete and the output results will be in the
/output
folder.