imagemin-webp
Advanced tools
Comparing version 6.0.0 to 7.0.0
18
index.js
@@ -1,7 +0,7 @@ | ||
'use strict'; | ||
const execBuffer = require('exec-buffer'); | ||
const isCwebpReadable = require('is-cwebp-readable'); | ||
const cwebp = require('cwebp-bin'); | ||
import {Buffer} from 'node:buffer'; | ||
import execBuffer from 'exec-buffer'; | ||
import isCwebpReadable from 'is-cwebp-readable'; | ||
import cwebp from 'cwebp-bin'; | ||
module.exports = (options = {}) => input => { | ||
const imageminWebp = (options = {}) => input => { | ||
if (!Buffer.isBuffer(input)) { | ||
@@ -17,3 +17,3 @@ return Promise.reject(new TypeError(`Expected \`input\` to be of type \`Buffer\` but received type \`${typeof input}\``)); | ||
'-quiet', | ||
'-mt' | ||
'-mt', | ||
]; | ||
@@ -37,3 +37,3 @@ | ||
if (options.size) { | ||
if (options.size > 0) { | ||
args.push('-size', options.size); | ||
@@ -83,3 +83,3 @@ } | ||
bin: cwebp, | ||
input | ||
input, | ||
}).catch(error => { | ||
@@ -90,1 +90,3 @@ error.message = error.stderr || error.message; | ||
}; | ||
export default imageminWebp; |
{ | ||
"name": "imagemin-webp", | ||
"version": "6.0.0", | ||
"version": "7.0.0", | ||
"description": "WebP imagemin plugin", | ||
"license": "MIT", | ||
"repository": "imagemin/imagemin-webp", | ||
"type": "module", | ||
"exports": "./index.js", | ||
"author": { | ||
@@ -20,3 +22,3 @@ "name": "Kevin Mårtensson", | ||
"engines": { | ||
"node": ">=10" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -43,4 +45,4 @@ "scripts": { | ||
"dependencies": { | ||
"cwebp-bin": "^5.0.0", | ||
"exec-buffer": "^3.0.0", | ||
"cwebp-bin": "^7.0.1", | ||
"exec-buffer": "^3.2.0", | ||
"is-cwebp-readable": "^3.0.0" | ||
@@ -50,5 +52,5 @@ }, | ||
"ava": "^3.8.0", | ||
"is-webp": "^1.0.0", | ||
"xo": "^0.30.0" | ||
"is-webp": "^2.0.0", | ||
"xo": "^0.47.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# imagemin-webp [![Build Status](https://travis-ci.org/imagemin/imagemin-webp.svg?branch=master)](https://travis-ci.org/imagemin/imagemin-webp) | ||
# imagemin-webp ![GitHub Actions Status](https://github.com/imagemin/imagemin-webp/workflows/test/badge.svg?branch=main) | ||
@@ -16,8 +16,9 @@ > WebP [imagemin](https://github.com/imagemin/imagemin) plugin | ||
```js | ||
const imagemin = require('imagemin'); | ||
const imageminWebp = require('imagemin-webp'); | ||
import imagemin from 'imagemin'; | ||
import imageminWebp from 'imagemin-webp'; | ||
(async () => { | ||
await imagemin(['images/*.{jpg,png}'], 'build/images', { | ||
use: [ | ||
await imagemin(['images/*.{jpg,png}'], { | ||
destination: 'build/images', | ||
plugins: [ | ||
imageminWebp({quality: 50}) | ||
@@ -24,0 +25,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
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
6279
207726
68
142
Yes
+ Addedcwebp-bin@7.0.1(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedcamelcase@2.1.1(transitive)
- Removedcamelcase-keys@2.1.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedconsole-stream@0.1.1(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removedcwebp-bin@5.1.0(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedfigures@1.7.0(transitive)
- Removedfind-up@1.1.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedindent-string@2.1.0(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedlogalot@2.1.0(transitive)
- Removedlongest@1.0.1(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedlpad-align@1.1.2(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmeow@3.7.0(transitive)
- Removedminimist@1.2.8(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-exists@2.1.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-type@1.1.0(transitive)
- Removedread-pkg@1.1.0(transitive)
- Removedread-pkg-up@1.0.1(transitive)
- Removedredent@1.0.0(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedresolve@1.22.8(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedsqueak@1.3.0(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedstrip-indent@1.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedtrim-newlines@1.0.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
Updatedcwebp-bin@^7.0.1
Updatedexec-buffer@^3.2.0