talira

SVG optimizer for Node.js and the command line

open sourceMITself-hostablefree

SVGO (SVG Optimizer) is an MIT-licensed Node.js library and command-line tool that makes SVG files smaller by removing what vector editors leave behind: editor metadata, comments, hidden elements, default or suboptimal values and other content that can be dropped or rewritten without changing how the image renders. It processes single files or whole folders recursively, outputs files or data URIs, and is built from plugins, with a default preset and a config file (svgo.config.mjs) to turn plugins on or off or add your own. Many tools bundle it or integrate with it, including Docusaurus, PostCSS and webpack, and the website has a browser playground.

Problems it solves

  • SVG files exported from Illustrator or Figma are bloated with metadata
  • minify all the SVG icons in a folder from the command line
  • optimize SVGs automatically in my webpack or PostCSS build
  • make inline SVGs smaller to speed up my website
  • turn SVGs into compact data URIs for CSS

Features

  • removes editor metadata, comments, hidden elements and default values
  • CLI for files and recursive folders
  • JavaScript API for Node.js
  • plugin architecture with a default preset and custom plugins
  • config file (svgo.config.mjs) with multipass, pretty printing and data URI output
  • integrations in Docusaurus, PostCSS, webpack and other tools
  • browser playground on the website

Capabilities

Has an APIplan not known
Has a command line toolplan not known
Takes pluginsplan not known
Has official SDKsplan not known