image-2-min
Image minifier that respects folder structure.. :)
Install
$ npm install --save image-2-min
Usage
const imagemin = ;const imageminJpegtran = ;const imageminPngquant = ; ;
API
imagemin(input, output, [options])
Returns Promise<Object[]>
in the format {data: Buffer, path: String}
.
input
Type: array
Files to be optimized. See supported minimatch
patterns.
output
Type: string
Set the destination folder to where your files will be written. If no destination is specified no files will be written.
options
plugins
Type: array
Array of plugins to use.
cwd
Type: string
The working directoy for image lookups.
imagemin.buffer(buffer, [options])
Returns a promise for a buffer.
buffer
Type: buffer
The buffer to optimize.
cwd
Type: string
The working directoy for image lookups.
Related
- imagemin-cli - CLI for this module
- imagemin-app - GUI app for this module
- gulp-imagemin - Gulp plugin
- grunt-contrib-imagemin - Grunt plugin
License
MIT © imagemin