Quick and dirty code to convert png
and jpg
images to webp
format.
- Nodejs >= 20
- Clone the repository.
- install dependencies with
npm i
From the root of this repository, convert all images of another directory to webp
:
node src/index.mjs /target-images-directory
It will create new files with the same name and the webp
extension and "slugify" names.