LinuxCommandLibrary

svgo

svgo

TLDR

Optimize a file using the default plugins (overwrites the original file)

$ svgo [test.svg]
copy


Optimize a file and save the result to another file
$ svgo [test.svg] -o [test.min.svg]
copy


Optimize all SVG files within a directory (overwrites the original files)
$ svgo -f [path/to/directory/with/svg/files]
copy


Optimize all SVG files within a directory and save the resulting files to another directory
$ svgo -f [path/to/input/directory] -o [path/to/output/directory]
copy


Optimize SVG content passed from another command, and save the result to a file
$ [cat test.svg] | svgo -i - -o [test.min.svg]
copy


Optimize a file and print out the result
$ svgo [test.svg] -o -
copy


Show available plugins
$ svgo --show-plugins
copy

Help

Usage: svgo [options] [INPUT...] 

Nodejs-based tool for optimizing SVG vector graphics files 

Arguments:
  INPUT                      Alias to --input 

Options:
  -v, --version              output the version number 
  -i, --input      Input files, "-" for STDIN 
  -s, --string       Input SVG data string 
  -f, --folder       Input folder, optimize and rewrite all *.svg files 
  -o, --output    Output file or folder (by default the same as the 
                             input), "-" for STDOUT 
  -p, --precision   Set number of digits in the fractional part, 
                             overrides plugins params 
  --config           Custom config file, only .js is supported 
  --datauri          Output as Data URI string (base64), URI encoded 
                             (enc) or unencoded (unenc) 
  --multipass                Pass over SVGs multiple times to ensure all 
                             optimizations are applied 
  --pretty                   Make SVG pretty printed 
  --indent          Indent number when pretty printing SVGs 
  --eol                 Line break to use when outputting SVG: lf, crlf. 
                             If unspecified, uses platform default. 
  --final-newline            Ensure SVG ends with a line break 
  -r, --recursive            Use with '--folder'. Optimizes *.svg files in 
                             folders recursively. 
  --exclude      Use with '--folder'. Exclude files matching 
                             regular expression pattern. 
  -q, --quiet                Only output error messages, not regular status 
                             messages 
  --show-plugins             Show available plugins and exit 
  --no-color                 Output plain text without color 
  -h, --help                 display help for command 

Copied to clipboard