imagemin
Minify images seamlessly
Install
$ npm install imagemin
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
Type: Object
plugins
Type: Array
Plugins to use.
imagemin.buffer(buffer, [options])
Returns Promise<Buffer>
.
buffer
Type: Buffer
Buffer to optimize.
options
Type: Object
plugins
Type: Array
Plugins to use.
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