You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
rdrew 1440706ce3 fixed gulp 6 years ago
..
node_modules/replace-ext fixed gulp 6 years ago
index.js fixed gulp 6 years ago
license fixed gulp 6 years ago
package.json fixed gulp 6 years ago
readme.md fixed gulp 6 years ago

readme.md

imagemin Build Status Build status

Minify images seamlessly

Install

$ npm install --save imagemin

Usage

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

imagemin(['images/*.{jpg,png}'], 'build/images', {
	plugins: [
		imageminJpegtran(),
		imageminPngquant({quality: '65-80'})
	]
}).then(files => {
	console.log(files);
	//=> [{data: <Buffer 89 50 4e …>, path: 'build/images/foo.jpg'}, …]
});

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.

License

MIT © imagemin