Socket
Socket
Sign inDemoInstall

imagemin-pngquant

Package Overview
Dependencies
187
Maintainers
6
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.1.0 to 6.0.0

40

index.js

@@ -7,5 +7,3 @@ 'use strict';

module.exports = opts => input => {
opts = Object.assign({}, opts);
module.exports = (options = {}) => input => {
const isBuffer = Buffer.isBuffer(input);

@@ -23,30 +21,34 @@

if (opts.floyd && typeof opts.floyd === 'number') {
args.push(`--floyd=${opts.floyd}`);
if (options.floyd && typeof options.floyd === 'number') {
args.push(`--floyd=${options.floyd}`);
}
if (opts.floyd && typeof opts.floyd === 'boolean') {
if (options.floyd && typeof options.floyd === 'boolean') {
args.push('--floyd');
}
if (opts.nofs) {
if (options.nofs) {
args.push('--nofs');
}
if (opts.posterize) {
args.push('--posterize', opts.posterize);
if (options.posterize) {
args.push('--posterize', options.posterize);
}
if (opts.quality) {
args.push('--quality', opts.quality);
if (options.quality) {
args.push('--quality', options.quality);
}
if (opts.speed) {
args.push('--speed', opts.speed);
if (options.speed) {
args.push('--speed', options.speed);
}
if (opts.verbose) {
if (options.verbose) {
args.push('--verbose');
}
if (options.strip) {
args.push('--strip');
}
const cp = execa(pngquant, args, {

@@ -58,10 +60,10 @@ encoding: null,

const promise = cp
.then(res => res.stdout)
.catch(err => {
if (err.code === 99) {
.then(result => result.stdout)
.catch(error => {
if (error.code === 99) {
return input;
}
err.message = err.stderr || err.message;
throw err;
error.message = error.stderr || error.message;
throw error;
});

@@ -68,0 +70,0 @@

{
"name": "imagemin-pngquant",
"version": "5.1.0",
"version": "6.0.0",
"description": "pngquant imagemin plugin",
"license": "MIT",
"repository": "imagemin/imagemin-pngquant",
"author": {
"name": "Kevin Mårtensson",
"email": "kevinmartensson@gmail.com",
"url": "github.com/imagemin"
},
"maintainers": [
{
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
{
"name": "Shinnosuke Watanabe",
"url": "github.com/shinnn"
}
],
"engines": {
"node": ">=4"
"node": ">=6"
},

@@ -46,3 +30,3 @@ "scripts": {

"is-stream": "^1.1.0",
"pngquant-bin": "^4.0.0"
"pngquant-bin": "^5.0.0"
},

@@ -49,0 +33,0 @@ "devDependencies": {

@@ -79,2 +79,9 @@ # imagemin-pngquant [![Build Status](https://travis-ci.org/imagemin/imagemin-pngquant.svg?branch=master)](https://travis-ci.org/imagemin/imagemin-pngquant) [![Build status](https://ci.appveyor.com/api/projects/status/w60auppnbiwgu9gj?svg=true)](https://ci.appveyor.com/project/kevva/imagemin-pngquant)

##### strip
Type: `boolean`<br>
Default: `false` (`true` on macOS)
Remove optional metadata.
#### input

@@ -81,0 +88,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