imagemin
Advanced tools
Comparing version 3.2.0 to 3.2.1
31
cli.js
#!/usr/bin/env node | ||
'use strict'; | ||
var fs = require('fs'); | ||
@@ -29,3 +28,3 @@ var path = require('path'); | ||
' -p, --progressive Lossless conversion to progressive' | ||
].join('\n') | ||
] | ||
}, { | ||
@@ -84,19 +83,19 @@ boolean: [ | ||
if (process.stdin.isTTY) { | ||
if (!cli.input.length && process.stdin.isTTY) { | ||
console.error([ | ||
'Provide at least one file to optimize', | ||
'', | ||
'Example', | ||
' imagemin images/* build', | ||
' imagemin foo.png > foo-optimized.png', | ||
' cat foo.png | imagemin > foo-optimized.png' | ||
].join('\n')); | ||
process.exit(1); | ||
} | ||
if (cli.input.length) { | ||
var src = cli.input; | ||
var dest; | ||
if (!cli.input.length) { | ||
console.error([ | ||
'Provide at least one file to optimize', | ||
'', | ||
'Example', | ||
' imagemin images/* build', | ||
' imagemin foo.png > foo-optimized.png', | ||
' cat foo.png | imagemin > foo-optimized.png' | ||
].join('\n')); | ||
process.exit(1); | ||
} | ||
if (src.length > 1 && !isFile(src[src.length - 1])) { | ||
@@ -103,0 +102,0 @@ dest = src[src.length - 1]; |
10
index.js
@@ -6,4 +6,4 @@ 'use strict'; | ||
var optional = require('optional'); | ||
var PassThrough = require('readable-stream/passthrough'); | ||
var streamCombiner = require('stream-combiner2'); | ||
var through = require('through2'); | ||
var vinylFs = require('vinyl-fs'); | ||
@@ -82,3 +82,3 @@ | ||
stream.on('error', cb); | ||
stream.pipe(concatStream(cb.bind(null, null))); | ||
stream.pipe(concatStream({objectMode: true}, cb.bind(null, null))); | ||
}; | ||
@@ -106,3 +106,3 @@ | ||
return streamCombiner(this.streams); | ||
return streamCombiner.obj(this.streams); | ||
}; | ||
@@ -137,4 +137,6 @@ | ||
module.exports[plugin] = optional('imagemin-' + plugin) || function () { | ||
return through.ctor({objectMode: true}); | ||
return function () { | ||
new PassThrough({objectMode: true}); | ||
}; | ||
}; | ||
}); |
{ | ||
"name": "imagemin", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "Minify images", | ||
@@ -10,3 +10,3 @@ "license": "MIT", | ||
"email": "kevinmartensson@gmail.com", | ||
"url": "https://github.com/kevva" | ||
"url": "github.com/kevva" | ||
}, | ||
@@ -17,5 +17,3 @@ "engines": { | ||
}, | ||
"bin": { | ||
"imagemin": "cli.js" | ||
}, | ||
"bin": "cli.js", | ||
"scripts": { | ||
@@ -25,4 +23,4 @@ "test": "node test/test.js" | ||
"files": [ | ||
"cli.js", | ||
"index.js" | ||
"index.js", | ||
"cli.js" | ||
], | ||
@@ -42,7 +40,7 @@ "keywords": [ | ||
"get-stdin": "^4.0.1", | ||
"meow": "^3.0.0", | ||
"meow": "^3.3.0", | ||
"optional": "^0.1.0", | ||
"path-exists": "^1.0.0", | ||
"stream-combiner2": "^1.0.2", | ||
"through2": "^0.6.1", | ||
"readable-stream": "^2.0.0", | ||
"stream-combiner2": "^1.1.1", | ||
"vinyl-fs": "^1.0.0" | ||
@@ -49,0 +47,0 @@ }, |
@@ -21,3 +21,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) | ||
.dest('build/images') | ||
.use(Imagemin.jpegtran({progressive: true})); | ||
.use(Imagemin.jpegtran({progressive: true})) | ||
.run(function (err, files) { | ||
@@ -24,0 +24,0 @@ console.log(files[0]); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10113
212
1
+ Addedreadable-stream@^2.0.0
- Removedthrough2@^0.6.1
Updatedmeow@^3.3.0
Updatedstream-combiner2@^1.1.1