imagemin-webp
Advanced tools
Comparing version 7.0.0 to 8.0.0
@@ -57,3 +57,7 @@ import {Buffer} from 'node:buffer'; | ||
if (options.lossless) { | ||
args.push('-lossless'); | ||
if (typeof options.lossless === 'number') { | ||
args.push('-z', options.lossless); | ||
} else { | ||
args.push('-lossless'); | ||
} | ||
} | ||
@@ -60,0 +64,0 @@ |
{ | ||
"name": "imagemin-webp", | ||
"version": "7.0.0", | ||
"version": "8.0.0", | ||
"description": "WebP imagemin plugin", | ||
@@ -9,16 +9,4 @@ "license": "MIT", | ||
"exports": "./index.js", | ||
"author": { | ||
"name": "Kevin Mårtensson", | ||
"email": "kevinmartensson@gmail.com", | ||
"url": "github.com/kevva" | ||
}, | ||
"maintainers": [ | ||
{ | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
} | ||
], | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
"node": ">=14.16" | ||
}, | ||
@@ -45,3 +33,3 @@ "scripts": { | ||
"dependencies": { | ||
"cwebp-bin": "^7.0.1", | ||
"cwebp-bin": "^8.0.0", | ||
"exec-buffer": "^3.2.0", | ||
@@ -51,6 +39,6 @@ "is-cwebp-readable": "^3.0.0" | ||
"devDependencies": { | ||
"ava": "^3.8.0", | ||
"ava": "^5.1.1", | ||
"is-webp": "^2.0.0", | ||
"xo": "^0.47.0" | ||
"xo": "^0.53.1" | ||
} | ||
} |
@@ -5,10 +5,8 @@ # imagemin-webp ![GitHub Actions Status](https://github.com/imagemin/imagemin-webp/workflows/test/badge.svg?branch=main) | ||
## Install | ||
```sh | ||
npm install imagemin-webp | ||
``` | ||
$ npm install imagemin-webp | ||
``` | ||
## Usage | ||
@@ -20,15 +18,12 @@ | ||
(async () => { | ||
await imagemin(['images/*.{jpg,png}'], { | ||
destination: 'build/images', | ||
plugins: [ | ||
imageminWebp({quality: 50}) | ||
] | ||
}); | ||
await imagemin(['images/*.{jpg,png}'], { | ||
destination: 'build/images', | ||
plugins: [ | ||
imageminWebp({quality: 50}) | ||
] | ||
}); | ||
console.log('Images optimized'); | ||
})(); | ||
console.log('Images optimized'); | ||
``` | ||
## API | ||
@@ -46,3 +41,3 @@ | ||
Type: `string`<br> | ||
Type: `string`\ | ||
Default: `default` | ||
@@ -54,3 +49,3 @@ | ||
Type: `number`<br> | ||
Type: `number`\ | ||
Default: `75` | ||
@@ -62,3 +57,3 @@ | ||
Type: `number`<br> | ||
Type: `number`\ | ||
Default: `100` | ||
@@ -70,3 +65,3 @@ | ||
Type: `number`<br> | ||
Type: `number`\ | ||
Default: `4` | ||
@@ -78,3 +73,3 @@ | ||
Type: `number`<br> | ||
Type: `number` | ||
@@ -85,4 +80,4 @@ Set target size in bytes. | ||
Type: `number`<br> | ||
Default: `80` | ||
Type: `number`\ | ||
Default: `50` | ||
@@ -93,3 +88,3 @@ Set the amplitude of spatial noise shaping between `0` and `100`. | ||
Type: `number`<br> | ||
Type: `number` | ||
@@ -100,4 +95,4 @@ Set deblocking filter strength between `0` (off) and `100`. | ||
Type: `boolean`<br> | ||
Default: `false`<br> | ||
Type: `boolean`\ | ||
Default: `false` | ||
@@ -108,3 +103,3 @@ Adjust filter strength automatically. | ||
Type: `number`<br> | ||
Type: `number`\ | ||
Default: `0` | ||
@@ -116,10 +111,10 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean | number`\ | ||
Default: `false` | ||
Encode images losslessly. | ||
Encode images losslessly. If set to a number, activates lossless preset with given level between `0` (fastest, larger files) and `9` (slowest, smaller files). | ||
##### nearLossless | ||
Type: `number`<br> | ||
Type: `number`\ | ||
Default: `100` | ||
@@ -143,4 +138,4 @@ | ||
Type: `string | string[]`<br> | ||
Default: `none`<br> | ||
Type: `string | string[]`\ | ||
Default: `none`\ | ||
Values: `all` `none` `exif` `icc` `xmp` | ||
@@ -147,0 +142,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72
6179
2
137
+ Addedcwebp-bin@8.0.0(transitive)
- Removedcwebp-bin@7.0.1(transitive)
Updatedcwebp-bin@^8.0.0