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

imagemin-webp

Package Overview
Dependencies
Maintainers
3
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 3.0.0 to 3.0.1

license

19

index.js
'use strict';
var ExecBuffer = require('exec-buffer');
var imageType = require('image-type');
var isCwebpReadable = require('is-cwebp-readable');
var replaceExt = require('replace-ext');

@@ -9,13 +9,6 @@ var through = require('through2');

/**
* webp imagemin plugin
*
* @param {Object} opts
* @api public
*/
module.exports = function (opts) {
opts = opts || {};
return through.ctor({ objectMode: true }, function (file, enc, cb) {
return through.ctor({objectMode: true}, function (file, enc, cb) {
if (file.isNull()) {

@@ -31,3 +24,3 @@ cb(null, file);

if (['jpg', 'png', 'tif'].indexOf(imageType(file.contents)) === -1) {
if (!isCwebpReadable(file.contents)) {
cb(null, file);

@@ -37,3 +30,3 @@ return;

var exec = new ExecBuffer();
var execBuffer = new ExecBuffer();
var args = ['-quiet', '-mt'];

@@ -81,4 +74,4 @@

exec
.use(webp, args.concat([exec.src(), '-o', exec.dest()]))
execBuffer
.use(webp, args.concat([execBuffer.src(), '-o', execBuffer.dest()]))
.run(file.contents, function (err, buf) {

@@ -85,0 +78,0 @@ if (err) {

{
"name": "imagemin-webp",
"version": "3.0.0",
"version": "3.0.1",
"description": "webp imagemin plugin",

@@ -37,4 +37,4 @@ "license": "MIT",

"cwebp-bin": "^2.0.0",
"exec-buffer": "^1.0.0",
"image-type": "^1.0.0",
"exec-buffer": "^2.0.0",
"is-cwebp-readable": "^1.0.0",
"replace-ext": "0.0.1",

@@ -41,0 +41,0 @@ "through2": "^0.6.1"

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