Packages

svgo

4.1.0 · 24 Aug 2026MIT52.3M / weekRepositoryHomepagenpmAtom feed

Your version

107 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 4.x · latest line
  2. 4.1.0

    24 Aug 2026
    • Security

      Filters executable data: URLs containing HTML, XHTML, or SVG documents while preserving inert data such as PNG images, and filters legacy vbscript: URLs (#2263).

    • Security

      Sanitizes content inside SVG <foreignObject> elements by removing HTML event-handler attributes, srcdoc, and executable URLs from action, data, formaction, href, and src, while preserving non-executable HTML and visual content (#2264).

    • Security

      Recognizes namespace-prefixed SVG <a> elements and removes ASCII tabs and newlines before checking URL schemes, preventing values such as java&#9;script: from bypassing detection while preserving elements in unrelated custom namespaces (#2268).

  3. 4.0.2

    11 Jul 2026
    • Security

      removeScripts, remove JavaScript URIs case-insensitively and make <script> handling namespace aware.

    • convertColors, skip case-normalization for CSS custom properties.

    • convertPathData, improve handling of consecutive t commands.

  4. 4.0.1

    4 Mar 2026
  5. 4.0.0

    21 Jun 2025
    • Breaking

      removeViewBox removes the scalability of SVGs.

    • Breaking

      removeTitle reduces accessibility, which preserving accessibility is more important than optimization.

    • Breaking

      svgo — for normal usage, such as scripts or server-side applications.

  6. 3.x
  7. 3.3.5

    24 Aug 2026
    • Security

      Backport the removeScriptElement hardening from SVGO v4 in #2269:

  8. 3.3.4

    11 Jul 2026
    • Security

      removeScriptElement, remove JavaScript URIs case-insensitively and make <script> handling namespace aware.

  9. 3.3.3

    4 Mar 2026
    • No longer throws error when encountering comments in DTD.

  10. 3.3.2

    9 May 2024

    An update on what happened with v3.3.0 and v3.3.1. While we have retained CJS support, the migration to ESM has changed the acceptable ways to import SVGO, in ways that users depended on before. This effectively made SVGO v3 a breaking change.

  11. 3.3.1

    8 May 2024

    SVGO v3.3.0, which was meant to migrate to ESM without breaking CJS support, unfortunately broke CJS projects. There was a mistake with exports, so the loadConfig function wasn't available in the CJS bundle and lead to issues for many users.

  12. 3.3.0

    8 May 2024
    • Deprecated

      removeDeprecatedAttrs, new plugin that is disabled by default to remove SVG attributes that are deprecated.

    • convertColors, now converts all references to colors excluding references to IDs to lowercase. This can be disabled by setting convertCase to false.

    • cleanupIds, treat both URI encoded and non-URI encoded IDs as the same.

  13. 3.2.0

    2 Jan 2024
    • convertPathData, fix instances were q was incorrectly converted to t.

    • convertTransform, fix for some transforms that weren't being converted correctly.

    • convertPathData, improves closing paths and how we determine if to use absolute or relative commands.

  14. 3.1.0

    11 Dec 2023
  15. 3.0.5

    30 Nov 2023
    • cleanupIds, correctly handle references to other nodes in animations.

    • convertPathData, fix issue when removing redundant Z between mergable M/m commands.

    • convertPathData, adhere to error/precision in z conversions.

  16. 3.0.4

    18 Nov 2023
    • removeXMLNS, no longer removes the XLink (xmlns:xlink) namespace. If that is desirable, you should enable the new removeXlink plugin, which does more while being safer.

    • convertPathData, ignore instances where transform applied via style tag.

    • inlineStyles, inline properties with the same specificity in the order that they appear in the stylesheet.

  17. 3.0.3

    8 Nov 2023
    • removeComments, introduces preservePatterns parameter. Preserves legal comments by default, same as the previous behavior, but can now be overridden.

    • removeDesc, set the removeAny parameter to false by default for accessibility.

    • removeRasterImages, removes inline JPEG images.

  18. 3.0.2

    18 Nov 2022

    Installing @types/csso no longer required

  19. 3.0.1

    11 Nov 2022
    • Store exposed types only in .d.ts files, no longer need to enable js checking

    • Update svgo.browser.js

    • Fixed "begin" attribute cleanup

  20. 3.0.0

    23 Oct 2022
    • Breaking

      Node.js 14+ is required for version

    • Breaking

      Stable package is replaced with native stable sort (required node 12+)

    • Fixed datauri option when multipass is not enabled

  21. 2.x
  22. 2.8.4

    24 Aug 2026
    • Security

      Backport the removeScriptElement hardening from SVGO v4 in #2272:

  23. 2.8.3

    11 Jul 2026
  24. 2.8.2

    4 Mar 2026
    • No longer throws error when encountering comments in DTD.

  25. 2.8.1

    4 Mar 2026
    • No longer throws error when encountering comments in DTD.

  26. 2.8.0

    2 Nov 2021
    • Added --no-color flag for testing purposes but you may find it useful (#1588)

    • Handle url() in style attributes properly (#1592)

    • removeXMLNS plugin now removes xmlns:xlink attribute (#1508)

  27. 2.7.0

    23 Sep 2021
    • Added validation to removeAttrs plugin (#1582)

    • collapseGroups (#1572)

    • mergeStyles (#1575)

  28. 2.6.1

    15 Sep 2021
    • Fixed optimize(svg) usage without config (#1573)

    • Added missing filter primitives to collections (#1571)

    • Migrated to visitor plugin api and covered with tsdoc removeEmptyContainers plugin (#1570)

  29. 2.6.0

    13 Sep 2021
  30. 2.5.0

    28 Aug 2021
    • Fixed removing transform-origin attribute (680e143)

    • Fixed applying transform to path arc with zero radius (ac8edba)

    • addAttributesToSVGElement

  31. 2.4.0

    13 Aug 2021
    • Removed

      Remove more spaces around flag in arc command #1484

    • Performance is improved by ~37% for svg with styles (#1456)

    • Reset cursor after "closeto" command when applying transformation (9e578b5)

  32. 2.3.1

    26 Jun 2021

    Fixed vulnerability in css-select dependency (#1485)

  33. 2.3.0

    28 Mar 2021
    • The new plugin is added for merging style elements into one. See #1381

    • CLI got new --exclude flag which uses regexps to exclude some files from --folder. See #1409

    • Internal AST is migrated to XAST. This spec makes maintaining plugins easier and may be used as interop with other tools like SVGR.

  34. 2.2.2

    9 Mar 2021
    • Ignore keyframes in computeStyle (ddbd704)

  35. 2.2.1

    6 Mar 2021
    • Fixed scientific notation parsing in paths (d6f972c)

    • Forbade invalid <style> type attribute in inlineStyles plugin (#1400)

    • Fixed <style> support in removeHiddenElems plugin (#1399)

  36. 2.2.0

    1 Mar 2021
    • Fixed optimisation when stroke-linecap=round is specified (7901588)

    • Prevented transform applying when inline style is present (79dbb4b)

    • Apply transform to stroke-dasharray and stroke-dashoffset (dd37fcf)

  37. 2.1.0

    23 Feb 2021
    • We forked sax parser to fix issues inaccessible from public api (github.com/svg/sax)

    • We added regression tests which already caught 4 bugs (WIP)

    • Fixed empty <svg /> with enabled cleanupIDs plugin (9b97e06)

  38. 2.0.3

    20 Feb 2021
    • Reduced browser build size 1450kB -> 820kB (82778c8)

    • Fixed adding empty <defs> by reusePaths plugin (#1201)

    • Fixed reporting parsing errors (ea82cc2)

  39. 2.0.2

    19 Feb 2021
    • Added better docs (#1337)

    • Removed unsafe usage of Buffer constructor (#1341)

    • Fixed incorrect regexp in convertStyleToAttrs plugin (#1338)

  40. 2.0.1

    18 Feb 2021
    • Fixed path intersection in mergePaths plugin (#1229)

    • Fixed --indent flag in CLI (#1331)

    • Fixed multipass option (#1332, #1177)

  41. 2.0.0

    17 Feb 2021
    • Smaller install size

    • Simplified config format

    • Added browser ready es module bundle

  42. 1.x
  43. 1.3.2

    30 Oct 2019
    • Fixed TypeError: Cannot set property 'multipassCount' of undefined

  44. 1.3.1

    29 Oct 2019
    • Updated CSSO version to 4.0.2 fixing the issue with empty semicolons ";;" in styles (thanks to @strarsis and @lahmatiy).

    • prefixIds plugin now runs only once with --multipass option

    • cleanupIDs plugin is prevented from producing a preserved ID, including one which matches a preserved prefix, when minifying

  45. 1.3.0

    14 Jul 2019
    • Custom plugins now can be loaded from external js through path plugin param.

    • New plugin convertEllipseToCircle to convert ellipse with equal radius measures to circle

    • New plugin sortDefsChildren for improved compression

  46. 1.2.2

    16 Apr 2019
    • Security

      Update js-yaml for Code Injection warning

  47. 1.2.1

    4 Apr 2019
    • Security

      Bump up js-yaml version to fix DoS vulnerability

  48. 1.2.0

    24 Feb 2019
    • Fixed extra blank lines when processing many files

    • Added --recursive option to process folders recursevely with option -f

    • Added removeAttributesBySelector plugin to remove elements matching a css selector

  49. 1.1.1

    17 Sep 2018
    • Fixed crash in SVGO.optimize() when ‘info’ is absent.

    • Removed extra space after cleanupListOfValues plugin.

  50. 1.1.0

    16 Sep 2018
    • Fixed collapseGroups plugin removing property with a child having inherit value.

    • version attribute value is not more being rounded.

    • Fixed jsAPI clone method with respect to the introduced CSS classes.

  51. 1.0.5

    26 Feb 2018

    Fixed issue with prefixIDs plugin not replacing url() values correctly

  52. 1.0.4

    30 Jan 2018
    • Fixed bug with removing groups that are direct child of <switch>.

    • Fixed bug with shorthand path points counting (thanks @alexjlockwood for noticing).

    • Fixed crash on parsing invalid transform, e.g. without close parenthesis.

  53. 1.0.3

    8 Nov 2017
    • Fixed removeViewBox plugin to check for zero start coordinates.

    • Removed extra info from STDOUT when it set to output.

  54. 1.0.2

    3 Nov 2017
    • Fixed a couple of errors related to inlineStyles plugin.

    • Updated some lost details in documentation to reflect v1.0 changes.

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.