Socket
Socket
Sign inDemoInstall

imagemin

Package Overview
Dependencies
22
Maintainers
5
Versions
48
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.2.2 to 5.3.0

10

index.js

@@ -6,5 +6,5 @@ 'use strict';

const globby = require('globby');
const mkdirp = require('mkdirp');
const makeDir = require('make-dir');
const pify = require('pify');
const promisePipe = require('promise.pipe');
const pPipe = require('p-pipe');
const replaceExt = require('replace-ext');

@@ -16,3 +16,3 @@

const dest = output ? path.join(output, path.basename(input)) : null;
const pipe = opts.plugins.length > 0 ? promisePipe(opts.plugins)(data) : Promise.resolve(data);
const pipe = opts.plugins.length > 0 ? pPipe(opts.plugins)(data) : Promise.resolve(data);

@@ -32,3 +32,3 @@ return pipe

return pify(mkdirp)(path.dirname(ret.path))
return makeDir(path.dirname(ret.path))
.then(() => fsP.writeFile(ret.path, ret.data))

@@ -67,5 +67,5 @@ .then(() => ret);

const pipe = opts.plugins.length > 0 ? promisePipe(opts.plugins)(input) : Promise.resolve(input);
const pipe = opts.plugins.length > 0 ? pPipe(opts.plugins)(input) : Promise.resolve(input);
return pipe.then(buf => buf.length < input.length ? buf : input);
};
{
"name": "imagemin",
"version": "5.2.2",
"version": "5.3.0",
"description": "Minify images",

@@ -44,8 +44,8 @@ "license": "MIT",

"dependencies": {
"file-type": "^3.8.0",
"globby": "^5.0.0",
"mkdirp": "^0.5.1",
"file-type": "^4.1.0",
"globby": "^6.1.0",
"make-dir": "^1.0.0",
"p-pipe": "^1.0.0",
"pify": "^2.3.0",
"promise.pipe": "^3.0.0",
"replace-ext": "0.0.1"
"replace-ext": "^1.0.0"
},

@@ -58,6 +58,5 @@ "devDependencies": {

"is-jpg": "^1.0.0",
"mkdirp": "^0.5.1",
"tempfile": "^1.1.1",
"tempy": "^0.1.0",
"xo": "*"
}
}

@@ -17,3 +17,3 @@ # imagemin [![Build Status](https://img.shields.io/travis/imagemin/imagemin.svg)](https://travis-ci.org/imagemin/imagemin) [![Build status](https://ci.appveyor.com/api/projects/status/wlnem7wef63k4n1t?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/imagemin)

const imagemin = require('imagemin');
const imageminMozjpeg = require('imagemin-mozjpeg');
const imageminJpegtran = require('imagemin-jpegtran');
const imageminPngquant = require('imagemin-pngquant');

@@ -23,3 +23,3 @@

plugins: [
imageminMozjpeg({targa: true}),
imageminJpegtran(),
imageminPngquant({quality: '65-80'})

@@ -38,7 +38,7 @@ ]

Returns a promise for an array of objects in the format `{data: Buffer, path: String}`.
Returns `Promise<Object[]>` in the format `{data: Buffer, path: String}`.
#### input
Type: `array`
Type: `Array`

@@ -55,25 +55,29 @@ Files to be optimized. See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).

Type: `Object`
##### plugins
Type: `array`
Type: `Array`
Array of [plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use.
[Plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use.
### imagemin.buffer(buffer, [options])
Returns a promise for a buffer.
Returns `Promise<Buffer>`.
#### buffer
Type: `buffer`
Type: `Buffer`
The buffer to optimize.
Buffer to optimize.
#### options
Type: `Object`
##### plugins
Type: `array`
Type: `Array`
Array of [plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use.
[Plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use.

@@ -80,0 +84,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