2017-06-04 20:45:52 +00:00
|
|
|
# svgo
|
|
|
|
#
|
2020-02-22 03:38:15 +00:00
|
|
|
# SVG Optimizer: a Node.js-based tool for optimizing Scalable Vector Graphics
|
|
|
|
# files. It applies a series of transformation rules (plugins), which can be
|
|
|
|
# toggled individually.
|
2017-06-04 14:35:24 +00:00
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Optimize a file using the default plugins, overwriting the original file.
|
2017-06-04 20:45:52 +00:00
|
|
|
svgo test.svg
|
2017-06-04 14:35:24 +00:00
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Optimize a file and save the result to another file.
|
2017-06-04 20:45:52 +00:00
|
|
|
svgo test.svg test.min.svg
|
2017-06-04 14:35:24 +00:00
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Optimize all SVG files within a directory, overwriting the original files.
|
|
|
|
svgo -f path/to/directory/with/svg/files
|
2017-06-04 14:35:24 +00:00
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Optimize all SVG files within a directory and save the resulting files to
|
|
|
|
# another directory.
|
|
|
|
svgo -f path/to/input/dir -o path/to/output/dir
|
2017-06-04 14:35:24 +00:00
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Optimize SVG content passed from another command, then save result to a file.
|
2017-06-04 20:45:52 +00:00
|
|
|
cat test.svg | svgo -i - -o test.min.svg
|
2017-06-04 14:35:24 +00:00
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Optimize a file and print out the result.
|
2017-06-04 20:45:52 +00:00
|
|
|
svgo test.svg -o -
|
2017-06-04 14:35:24 +00:00
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Optimize a file making sure a given plugin is enabled.
|
2017-06-04 20:45:52 +00:00
|
|
|
svgo --enable=plugin_name
|
2017-06-04 14:35:24 +00:00
|
|
|
|
2020-02-22 03:38:15 +00:00
|
|
|
# Show available plugins.
|
2017-06-04 20:45:52 +00:00
|
|
|
svgo --show-plugins
|