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

@mole-inc/imagemin-webp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mole-inc/imagemin-webp - npm Package Compare versions

Comparing version 6.0.1 to 7.0.0

25

index.js
'use strict';
const {cwebpBin} = require('@mole-inc/cwebp-bin');
const execBuffer = require('exec-buffer');
const isCwebpReadable = require('is-cwebp-readable');
const cwebp = require('@mole-inc/cwebp-bin');
module.exports = (options = {}) => input => {
module.exports = (options = {}) => async input => {
if (!Buffer.isBuffer(input)) {
return Promise.reject(new TypeError(`Expected \`input\` to be of type \`Buffer\` but received type \`${typeof input}\``));
throw new TypeError(`Expected \`input\` to be of type \`Buffer\` but received type \`${typeof input}\``);
}
if (!isCwebpReadable(input)) {
return Promise.resolve(input);
return input;
}

@@ -17,3 +17,3 @@

'-quiet',
'-mt'
'-mt',
];

@@ -79,10 +79,13 @@

return execBuffer({
args,
bin: cwebp,
input
}).catch(error => {
try {
return execBuffer({
args,
bin: cwebpBin.path,
input,
});
} catch (error) {
error.message = error.stderr || error.message;
throw error;
});
}
};
{
"name": "@mole-inc/imagemin-webp",
"version": "6.0.1",
"version": "7.0.0",
"description": "WebP imagemin plugin",

@@ -10,4 +10,5 @@ "license": "MIT",

},
"type": "commonjs",
"engines": {
"node": ">=10.13.0"
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},

@@ -17,3 +18,4 @@ "scripts": {

"coverage": "nyc report --reporter=lcov",
"release": "standard-version"
"release": "standard-version",
"prepare": "husky install"
},

@@ -40,4 +42,4 @@ "publishConfig": {

"dependencies": {
"@mole-inc/cwebp-bin": ">=6.0.0",
"exec-buffer": "^3.0.0",
"@mole-inc/cwebp-bin": "^9.0.2",
"exec-buffer": "^3.2.0",
"is-cwebp-readable": "^3.0.0"

@@ -48,9 +50,17 @@ },

"@commitlint/config-conventional": "latest",
"ava": "^3.7.1",
"husky": "^4.2.5",
"is-webp": "^1.0.0",
"nyc": "^15.0.1",
"ava": "^3.15.0",
"husky": "^7.0.4",
"is-webp": "^1.0.1",
"nyc": "^15.1.0",
"standard-version": "latest",
"xo": "^0.29.1"
"xo": "^0.43.0"
},
"xo": {
"rules": {
"unicorn/prefer-node-protocol": "off",
"unicorn/explicit-length-check": "off",
"unicorn/prefer-module": "off",
"node/prefer-global/buffer": "off"
}
}
}

@@ -1,2 +0,2 @@

# imagemin-webp ![Node CI](https://github.com/mole-inc/imagemin-webp/workflows/Node%20CI/badge.svg)
# 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)

@@ -3,0 +3,0 @@ > WebP [imagemin](https://github.com/mole-inc/imagemin) plugin

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