Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/imagemin/imagemin-svgo

SVGO plugin for imagemin
https://github.com/imagemin/imagemin-svgo

Last synced: 3 days ago
JSON representation

SVGO plugin for imagemin

Awesome Lists containing this project

README

        

# imagemin-svgo ![GitHub Actions Status](https://github.com/imagemin/imagemin-svgo/workflows/test/badge.svg?branch=main)

> [SVGO](https://github.com/svg/svgo) imagemin plugin

## Install

```sh
npm install imagemin-svgo
```

## Usage

```js
import imagemin from 'imagemin';
import imageminSvgo from 'imagemin-svgo';

await imagemin(['images/*.svg'], {
destination: 'build/images',
plugins: [
imageminSvgo({
plugins: [{
name: 'removeViewBox',
active: false
}]
})
]
});

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

## API

### imageminSvgo(options?)(buffer)

Returns a `Promise`.

#### options

Type: `object`

Pass options to [SVGO](https://github.com/svg/svgo#configuration).

#### buffer

Type: `Buffer`

The buffer to optimize.