imagemin-svgo
Advanced tools
Comparing version 0.1.1 to 1.0.0
23
index.js
@@ -14,16 +14,17 @@ 'use strict'; | ||
module.exports = function (opts) { | ||
opts = opts || {}; | ||
opts = opts || {}; | ||
return function (file, imagemin, cb) { | ||
if (!isSvg(file.contents)) { | ||
return cb(); | ||
} | ||
return function (file, imagemin, cb) { | ||
if (!isSvg(file.contents)) { | ||
cb(); | ||
return; | ||
} | ||
var svgo = new SVGO(opts); | ||
var svgo = new SVGO({ plugins: opts.plugins || [] }); | ||
svgo.optimize(file.contents.toString('utf8'), function (res) { | ||
file.contents = new Buffer(res.data); | ||
cb(); | ||
}); | ||
}; | ||
svgo.optimize(file.contents.toString('utf8'), function (res) { | ||
file.contents = new Buffer(res.data); | ||
cb(); | ||
}); | ||
}; | ||
}; |
{ | ||
"name": "imagemin-svgo", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "svgo image-min plugin", | ||
"license": "MIT", | ||
"repository": "kevva/imagemin-svgo", | ||
"repository": "imagemin/imagemin-svgo", | ||
"author": { | ||
@@ -16,3 +16,3 @@ "name": "Kevin Mårtensson", | ||
"scripts": { | ||
"test": "mocha --reporter list" | ||
"test": "node test/test.js" | ||
}, | ||
@@ -32,9 +32,9 @@ "files": [ | ||
"dependencies": { | ||
"is-svg": "^0.1.1", | ||
"svgo": "^0.4.4" | ||
"is-svg": "^1.0.0", | ||
"svgo": "^0.4.5" | ||
}, | ||
"devDependencies": { | ||
"image-min": "^0.4.2", | ||
"mocha": "^1.18.2" | ||
"ava": "0.0.4", | ||
"imagemin": "^1.0.2" | ||
} | ||
} |
@@ -1,11 +0,13 @@ | ||
# imagemin-svgo [![Build Status](https://travis-ci.org/kevva/imagemin-svgo.svg?branch=master)](https://travis-ci.org/kevva/imagemin-svgo) | ||
# imagemin-svgo [![Build Status](https://travis-ci.org/imagemin/imagemin-svgo.svg?branch=master)](https://travis-ci.org/imagemin/imagemin-svgo) | ||
> svgo image-min plugin | ||
## Install | ||
```bash | ||
```sh | ||
$ npm install --save imagemin-svgo | ||
``` | ||
## Usage | ||
@@ -25,2 +27,3 @@ | ||
## Options | ||
@@ -31,3 +34,3 @@ | ||
Type: `Array` | ||
Default: `undefined` | ||
Default: `[]` | ||
@@ -41,4 +44,5 @@ Customize which SVGO [plugins](https://github.com/svg/svgo/tree/master/plugins) to use. | ||
## License | ||
MIT © [Kevin Mårtensson](https://github.com/kevva) | ||
MIT © [imagemin](https://github.com/imagemin) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
23
1
46
1946
+ Addedis-svg@1.1.1(transitive)
- Removedis-svg@0.1.2(transitive)
Updatedis-svg@^1.0.0
Updatedsvgo@^0.4.5