# @mole-inc/imagemin-webp

> WebP imagemin plugin

Latest version **7.0.0** (published 2021-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mole-inc/imagemin-webp
pnpm add @mole-inc/imagemin-webp
yarn add @mole-inc/imagemin-webp
bun add @mole-inc/imagemin-webp
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2021-12-04 |
| First published | 2020-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 3 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | aaharu |
| Keywords | compress, cwebp, image, imageminplugin, img, jpg, minify, optimize, png, tif, webp |

## Links

- npm: https://www.npmjs.com/package/@mole-inc/imagemin-webp
- Repository: https://github.com/mole-inc/imagemin-webp
- Homepage: https://github.com/mole-inc/imagemin-webp#readme
- Issues: https://github.com/mole-inc/imagemin-webp/issues
- npm.io page: https://npm.io/package/@mole-inc/imagemin-webp

## Dependencies (3)

- [exec-buffer](https://npm.io/package/exec-buffer.md) ^3.2.0
- [is-cwebp-readable](https://npm.io/package/is-cwebp-readable.md) ^3.0.0
- [@mole-inc/cwebp-bin](https://npm.io/package/@mole-inc/cwebp-bin.md) ^9.0.2

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 7.0.0 (latest) — 2021-12-04
- 6.0.1 — 2021-06-19
- 6.0.0 — 2020-04-24

## README

# imagemin-webp [![Node CI](https://github.com/mole-inc/imagemin-webp/actions/workflows/nodejs.yml/badge.svg)](https://github.com/mole-inc/imagemin-webp/actions/workflows/nodejs.yml)

> WebP [imagemin](https://github.com/mole-inc/imagemin) plugin


## Install

```
$ npm install @mole-inc/imagemin-webp
```


## Usage

```js
const imagemin = require('imagemin');
const imageminWebp = require('@mole-inc/imagemin-webp');

(async () => {
	await imagemin(['images/*.{jpg,png}'], 'build/images', {
		use: [
			imageminWebp({quality: 50})
		]
	});

	console.log('Images optimized');
})();
```


## API

### imageminWebp(options?)(buffer)

Returns a `Promise<Buffer>` with the optimized image.

#### options

Type: `object`

##### preset

Type: `string`<br>
Default: `default`

Preset setting, one of `default`, `photo`, `picture`, `drawing`, `icon` and `text`.

##### quality

Type: `number`<br>
Default: `75`

Set quality factor between `0` and `100`.

##### alphaQuality

Type: `number`<br>
Default: `100`

Set transparency-compression quality between `0` and `100`.

##### method

Type: `number`<br>
Default: `4`

Specify the compression method to use, between `0` (fastest) and `6` (slowest). This parameter controls the trade off between encoding speed and the compressed file size and quality.

##### size

Type: `number`<br>

Set target size in bytes.

##### sns

Type: `number`<br>
Default: `80`

Set the amplitude of spatial noise shaping between `0` and `100`.

##### filter

Type: `number`<br>

Set deblocking filter strength between `0` (off) and `100`.

##### autoFilter

Type: `boolean`<br>
Default: `false`<br>

Adjust filter strength automatically.

##### sharpness

Type: `number`<br>
Default: `0`

Set filter sharpness between `0` (sharpest) and `7` (least sharp).

##### lossless

Type: `boolean`<br>
Default: `false`

Encode images losslessly.

##### nearLossless

Type: `number`<br>
Default: `100`

Encode losslessly with an additional [lossy pre-processing step](https://groups.google.com/a/webmproject.org/forum/#!msg/webp-discuss/0GmxDmlexek/3ggyYsaYdFEJ), with a quality factor between `0` (maximum pre-processing) and `100` (same as `lossless`).

##### crop

Type: `object { x: number, y: number, width: number, height: number }`

Crop the image.

##### resize

Type: `object { width: number, height: number }`

Resize the image. Happens after `crop`.

##### metadata

Type: `string | string[]`<br>
Default: `none`<br>
Values: `all` `none` `exif` `icc` `xmp`

A list of metadata to copy from the input to the output if present.

#### buffer

Type: `Buffer`

Buffer to optimize.


## License

This is a fork of [imagemin/imagemin-webp](https://github.com/imagemin/imagemin-webp).

see license file.

---
_Source: https://npm.io/package/@mole-inc/imagemin-webp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
