Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

imagemin-webp

Package Overview
Dependencies
Maintainers
7
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imagemin-webp - npm Package Compare versions

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 @@ ]

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc