svgo
Node.js-based SVG optimization tool
TLDR
Optimize SVG
SYNOPSIS
svgo [-o output] [-f folder] [--config file] [options] files
DESCRIPTION
svgo (SVG Optimizer) is a Node.js-based tool for optimizing SVG files through a plugin architecture. Each plugin handles a specific optimization such as removing metadata, simplifying path data, merging redundant elements, cleaning up attributes, or removing empty containers.
Plugins can be individually enabled or disabled through a configuration file or command-line flags, allowing fine-grained control over which optimizations are applied. The multipass option runs optimizations repeatedly until no further improvements are found. Folder mode batch-processes entire directories of SVG files.
SVGO is widely used in front-end build pipelines and icon library workflows to minimize SVG file sizes before deployment. Pretty-print mode reformats output for readability when human-editable SVGs are needed.
PARAMETERS
-o, --output FILE
Output file.-f, --folder DIR
Input folder.--config FILE
Config file.--disable PLUGIN
Disable plugin.--enable PLUGIN
Enable plugin.--pretty
Pretty print.--multipass
Multiple passes.-q, --quiet
Quiet output.
CONFIGURATION
svgo.config.js
Project configuration file defining enabled/disabled plugins and their options.
CAVEATS
Some optimizations may affect rendering. Test output visually. Complex SVGs need care.
HISTORY
SVGO (SVG Optimizer) is a Node.js tool for SVG optimization. It's widely used in build processes and icon libraries.
