@ixkaito/imagemin

0.1.0 • Public • Published

@ixkaito/imagemin

Minify images seamlessly while preserving directory structure

Based on imagemin but preserves directory structure. Inspired by imagemin-dir.

Install

$ npm install @ixkaito/imagemin

Usage

const imagemin = require('@ixkaito/imagemin'); // alternative to imagemin
const imageminJpegtran = require('imagemin-jpegtran');
const imageminPngquant = require('imagemin-pngquant');

(async () => {
	const files = await imagemin(['images/*.{jpg,png}'], {
		destination: 'build/images',
		plugins: [
			imageminJpegtran(),
			imageminPngquant({
				quality: [0.6, 0.8]
			})
		]
	});

	console.log(files);
	//=> [{data: <Buffer 89 50 4e …>, destinationPath: 'build/images/foo.jpg'}, …]
})();

API

@ixkaito/imagemin maintains the same API as imagemin. See https://github.com/imagemin/imagemin.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.0197latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.0197

Package Sidebar

Install

npm i @ixkaito/imagemin

Weekly Downloads

197

Version

0.1.0

License

MIT

Unpacked Size

3.95 kB

Total Files

4

Last publish

Collaborators

  • ixkaito