SVGO plugin for imagemin
Clone or download
Latest commit eba55fb Jul 23, 2018
Permalink
Failed to load latest commit information.
.editorconfig Meta tweaks Jul 23, 2018
.gitattributes Meta tweaks Jul 23, 2018
.gitignore Meta tweaks Oct 31, 2017
.npmrc Meta tweaks Oct 31, 2017
.travis.yml Meta tweaks Jul 23, 2018
appveyor.yml Require Node.js 6 and upgrade dependencies (#34) Jul 23, 2018
index.js Meta tweaks Jul 23, 2018
license Meta tweaks Jul 23, 2018
package.json 7.0.0 Jul 23, 2018
readme.md Meta tweaks Jul 23, 2018
test.js Use `new Buffer` until targeting Node.js v6 May 26, 2017

readme.md

imagemin-svgo Build Status Build status

SVGO imagemin plugin

Install

$ npm install imagemin-svgo

Usage

const imagemin = require('imagemin');
const imageminSvgo = require('imagemin-svgo');

(async () => {
	await imagemin(['images/*.svg'], 'build/images', {
		use: [
			imageminSvgo({
				plugins: [
					{removeViewBox: false}
				]
			})
		]
	});

	console.log('Images optimized');
})();

API

imageminSvgo([options])(buffer)

Returns a Promise<Buffer>.

options

Type: Object

Pass options to SVGO.

buffer

Type: Buffer

Buffer to optimize.

License

MIT © imagemin