A simple image converter for web developers.
Convert images asyncronously in bulk using Bun/Sharp.
Install 2webp globally using NPM
bun add -g 2webp
On Linux - make sure you have libvips
sudo apt-get install libvips-dev
When converting images 2webp will automatically batch and convert images asyncrounously. You can convert large folders of images safely with 2webp.
2webp {dir/file} {--output=/example} {--format=png/jpeg/gif/tiff/webp}
To convert all the images in the current directory to webp
The output is in current directory
2webp .
Specify output directory, convert all images in current dir
2webp . --output=./output
Convert all images in current dir to png
2webp . --format=png
To install dependencies:
bun install
To run:
bun run index.ts
This project was created using Bun.
Bun is a fast all-in-one JavaScript runtime.