2
0
mirror of https://github.com/chubin/cheat.sheets synced 2024-11-15 06:12:59 +00:00
cheat.sheets/sheets/svgo

31 lines
944 B
Plaintext
Raw Normal View History

2017-06-04 20:45:52 +00:00
# svgo
#
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# Show available plugins.
2017-06-04 20:45:52 +00:00
svgo --show-plugins