Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/imagemin/imagemin-svgo
- Owner: imagemin
- License: mit
- Created: 2014-04-24T09:18:48.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-06-15T21:41:29.000Z (5 months ago)
- Last Synced: 2024-07-10T14:33:47.864Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 75.2 KB
- Stars: 125
- Watchers: 9
- Forks: 28
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: license
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.