imagemin-svgo
Advanced tools
Comparing version 8.0.0 to 9.0.0
'use strict'; | ||
const isSvg = require('is-svg'); | ||
const SVGO = require('svgo'); | ||
const {optimize} = require('svgo'); | ||
@@ -16,5 +16,4 @@ module.exports = options => async buffer => { | ||
const svgo = new SVGO(options); | ||
const {data} = await svgo.optimize(buffer); | ||
const {data} = optimize(buffer, options); | ||
return Buffer.from(data); | ||
}; |
{ | ||
"name": "imagemin-svgo", | ||
"version": "8.0.0", | ||
"version": "9.0.0", | ||
"description": "SVGO imagemin plugin", | ||
"license": "MIT", | ||
"repository": "imagemin/imagemin-svgo", | ||
"funding": "https://github.com/sindresorhus/imagemin-svgo?sponsor=1", | ||
"funding": { | ||
"url": "https://github.com/sindresorhus/imagemin-svgo?sponsor=1" | ||
}, | ||
"engines": { | ||
@@ -28,3 +30,3 @@ "node": ">=10" | ||
"is-svg": "^4.2.1", | ||
"svgo": "^1.3.2" | ||
"svgo": "^2.1.0" | ||
}, | ||
@@ -31,0 +33,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
# imagemin-svgo [![Build Status](https://travis-ci.org/imagemin/imagemin-svgo.svg?branch=master)](https://travis-ci.org/imagemin/imagemin-svgo) | ||
# imagemin-svgo ![GitHub Actions Status](https://github.com/imagemin/imagemin-svgo/workflows/test/badge.svg?branch=master) | ||
@@ -18,10 +18,12 @@ > [SVGO](https://github.com/svg/svgo) imagemin plugin | ||
const imageminSvgo = require('imagemin-svgo'); | ||
const {extendDefaultPlugins} = require('svgo'); | ||
(async () => { | ||
await imagemin(['images/*.svg'], 'build/images', { | ||
use: [ | ||
await imagemin(['images/*.svg'], { | ||
destination: 'build/images', | ||
plugins: [ | ||
imageminSvgo({ | ||
plugins: [ | ||
{removeViewBox: false} | ||
] | ||
plugins: extendDefaultPlugins([ | ||
{name: 'removeViewBox', active: false} | ||
]) | ||
}) | ||
@@ -46,3 +48,3 @@ ] | ||
Pass options to [SVGO](https://github.com/svg/svgo#what-it-can-do). | ||
Pass options to [SVGO](https://github.com/svg/svgo#configuration). | ||
@@ -49,0 +51,0 @@ #### buffer |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
2954
59
0
14
+ Added@trysound/sax@0.2.0(transitive)
+ Addedcommander@7.2.0(transitive)
+ Addedcss-select@4.3.0(transitive)
+ Addedcss-what@6.1.0(transitive)
+ Addeddom-serializer@1.4.1(transitive)
+ Addeddomhandler@4.3.1(transitive)
+ Addeddomutils@2.8.0(transitive)
+ Addednth-check@2.1.1(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedsvgo@2.8.0(transitive)
- Removed@types/q@1.5.8(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedargparse@1.0.10(transitive)
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedarray.prototype.reduce@1.0.7(transitive)
- Removedarraybuffer.prototype.slice@1.0.3(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcoa@2.0.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcss-select@2.1.0(transitive)
- Removedcss-select-base-adapter@0.1.1(transitive)
- Removedcss-tree@1.0.0-alpha.37(transitive)
- Removedcss-what@3.4.2(transitive)
- Removeddata-view-buffer@1.0.1(transitive)
- Removeddata-view-byte-length@1.0.1(transitive)
- Removeddata-view-byte-offset@1.0.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removeddom-serializer@0.2.2(transitive)
- Removeddomelementtype@1.3.1(transitive)
- Removeddomutils@1.7.0(transitive)
- Removedes-abstract@1.23.5(transitive)
- Removedes-array-method-boxes-properly@1.0.0(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.0.3(transitive)
- Removedes-to-primitive@1.2.1(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedesprima@4.0.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunction.prototype.name@1.1.6(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedget-symbol-description@1.0.2(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-data-view@1.0.1(transitive)
- Removedis-date-object@1.0.5(transitive)
- Removedis-negative-zero@2.0.3(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-regex@1.1.4(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedis-weakref@1.0.2(transitive)
- Removedisarray@2.0.5(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedmdn-data@2.0.4(transitive)
- Removedminimist@1.2.8(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removednth-check@1.0.2(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedobject.getownpropertydescriptors@2.1.8(transitive)
- Removedobject.values@1.2.0(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedq@1.5.1(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedsafe-array-concat@1.1.2(transitive)
- Removedsafe-regex-test@1.0.3(transitive)
- Removedsax@1.2.4(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstring.prototype.trim@1.2.9(transitive)
- Removedstring.prototype.trimend@1.0.8(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedsvgo@1.3.2(transitive)
- Removedtyped-array-buffer@1.0.2(transitive)
- Removedtyped-array-byte-length@1.0.1(transitive)
- Removedtyped-array-byte-offset@1.0.2(transitive)
- Removedtyped-array-length@1.0.6(transitive)
- Removedunbox-primitive@1.0.2(transitive)
- Removedunquote@1.1.1(transitive)
- Removedutil.promisify@1.0.1(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
Updatedsvgo@^2.1.0