1. cwebp-bin
cwebp wrapper that makes it seamlessly available as a local dependency
cwebp-bin
Package: cwebp-bin
Created by: imagemin
Last modified: Tue, 14 Jun 2022 06:36:42 GMT
Version: 8.0.0
License: MIT
Downloads: 1,169,533
Repository: https://github.com/imagemin/cwebp-bin

Install

npm install cwebp-bin
yarn add cwebp-bin

cwebp-bin GitHub Actions Status

WebP is a new image format that provides lossless and lossy compression for images on the web. WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at equivalent SSIM index.

You probably want imagemin-webp instead.

Install

$ npm install cwebp-bin

Usage

 import {execFile} from 'node:child_process';
import cwebp from 'cwebp-bin';

execFile(cwebp, ['input.png', '-o', 'output.webp'], err => {
	if (err) {
		throw err;
	}

	console.log('Image is converted!');
});

CLI

$ npm install --global cwebp-bin
$ cwebp --help

License

MIT © Imagemin

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code