Socket
Socket
Sign inDemoInstall

imagemin-optipng

Package Overview
Dependencies
273
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.2.0 to 4.3.0

license

19

index.js
'use strict';
var ExecBuffer = require('exec-buffer');
var isPng = require('is-png');
var optipng = require('optipng-bin').path;
var optipng = require('optipng-bin');
var through = require('through2');
/**
* optipng 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()) {

@@ -34,3 +26,3 @@ cb(null, file);

var exec = new ExecBuffer();
var execBuffer = new ExecBuffer();
var args = ['-strip', 'all', '-clobber', '-force', '-fix'];

@@ -43,6 +35,7 @@ var optimizationLevel = opts.optimizationLevel || 2;

exec
.use(optipng, args.concat(['-out', exec.dest(), exec.src()]))
execBuffer
.use(optipng, args.concat(['-out', execBuffer.dest(), execBuffer.src()]))
.run(file.contents, function (err, buf) {
if (err) {
err.fileName = file.path;
cb(err);

@@ -49,0 +42,0 @@ return;

{
"name": "imagemin-optipng",
"version": "4.2.0",
"version": "4.3.0",
"description": "optipng imagemin plugin",

@@ -35,3 +35,3 @@ "license": "MIT",

"is-png": "^1.0.0",
"optipng-bin": "^2.0.0",
"optipng-bin": "^3.0.0",
"through2": "^0.6.1"

@@ -38,0 +38,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc