svgo
4.1.0 · 24 Aug 2026MIT52.3M / weekRepositoryHomepagenpmAtom feed
1.3.2 is the newest release of 1.x.
In short
1 breaking8 new3 fixed9 changed
- Breaking
SVGO now requires Node 4 or higher.
Security
3 advisories affect 1.0.0; 2.8.4 fixes them
- HighSVGO: removeScripts allows executable links through namespace and control-character bypassesGHSA-w27v-7q3p-w38r · 8 Sep 2026Fixed in 2.8.4
- HighSVGO removeScripts plugin leaves some executable scripts intactGHSA-2p49-hgcm-8545 · 21 Jul 2026Fixed in 2.8.3
- ModerateSVGO: removeScripts incompletely sanitizes executable HTML in SVG foreignObject elementsGHSA-4vpr-x523-8j87 · 8 Sep 2026Fixed in 2.8.4
Release note
- Breaking
SVGO now requires Node 4 or higher.
Changed CLI syntax to treat filenames as input, thus allowing
svgo *.svgsyntax.SVGO.optimize()now returnsPromise.Added
dataurioption to JS API.Added support for SVG 2
hrefattribute.cleanupIDsnow don't removes IDs if an image consists only ofdefs.New plugin
inlineStylesfor converting styles from<style>element to attributes if possiblecleanupNumericValuesnow rounds values inviewBoxNew plugin:
removeScriptElement(disabled by default) to align withremoveStyleElementminifyStylesnow removes styles based on usage with controlling optionsNew option
exceptincleanupIDsto keep IDsNew option
forceincleanupIDsto work even if SVG containsstyleorscriptelementsFixed arcs transforming with different signed
scaleparametersFixed
removeUselessStrokeAndFillto check forstyleorscriptelements per fileNew option
keepAriaAttrsinremoveUnknownsAndDefaultsCorrected parsing in
cleanupIDsto account animation syntax#ff0000now converts toredas well as#f00Added “gray” variation to colors list per CSS Color Module Level 4
Fixed error on empty files.
A separator character in
removeAttrsnow can be changed perelemSeparatoroptionaddAttributesToSVGElementnow can add values to attributes.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.