PageRenderTime 25ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/FurAndPaw/node_modules/svgo/README.md

https://gitlab.com/jLKisni/furandpaw-frontend
Markdown | 150 lines | 109 code | 41 blank | 0 comment | 0 complexity | 0e63be597b6d8a205cbfc519aff07383 MD5 | raw file
  1. **english** | [русский](https://github.com/svg/svgo/blob/master/README.ru.md)
  2. - - -
  3. <img src="https://svg.github.io/svgo-logo.svg" width="200" height="200" alt="logo"/>
  4. ## SVGO [![NPM version](https://badge.fury.io/js/svgo.svg)](https://npmjs.org/package/svgo) [![Dependency Status](https://gemnasium.com/svg/svgo.svg)](https://gemnasium.com/svg/svgo) [![Build Status](https://secure.travis-ci.org/svg/svgo.svg)](https://travis-ci.org/svg/svgo) [![Coverage Status](https://img.shields.io/coveralls/svg/svgo.svg)](https://coveralls.io/r/svg/svgo?branch=master)
  5. **SVG O**ptimizer is a Nodejs-based tool for optimizing SVG vector graphics files.
  6. ![](https://mc.yandex.ru/watch/18431326)
  7. ## Why?
  8. SVG files, especially exported from various editors, usually contain a lot of redundant and useless information such as editor metadata, comments, hidden elements, default or non-optimal values and other stuff that can be safely removed or converted without affecting SVG rendering result.
  9. ## What it can do
  10. SVGO has a plugin-based architecture, so almost every optimization is a separate plugin.
  11. Today we have:
  12. * [ [ cleanupAttrs](https://github.com/svg/svgo/blob/master/plugins/cleanupAttrs.js) ] cleanup attributes from newlines, trailing and repeating spaces
  13. * [ [ removeDoctype](https://github.com/svg/svgo/blob/master/plugins/removeDoctype.js) ] remove doctype declaration
  14. * [ [ removeXMLProcInst](https://github.com/svg/svgo/blob/master/plugins/removeXMLProcInst.js) ] remove XML processing instructions
  15. * [ [ removeComments](https://github.com/svg/svgo/blob/master/plugins/removeComments.js) ] remove comments
  16. * [ [ removeMetadata](https://github.com/svg/svgo/blob/master/plugins/removeMetadata.js) ] remove `<metadata>`
  17. * [ [ removeTitle](https://github.com/svg/svgo/blob/master/plugins/removeTitle.js) ] remove `<title>` (disabled by default)
  18. * [ [ removeDesc](https://github.com/svg/svgo/blob/master/plugins/removeDesc.js) ] remove `<desc>` (only non-meaningful by default)
  19. * [ [ removeUselessDefs](https://github.com/svg/svgo/blob/master/plugins/removeUselessDefs.js) ] remove elements of `<defs>` without `id`
  20. * [ [ removeEditorsNSData](https://github.com/svg/svgo/blob/master/plugins/removeEditorsNSData.js) ] remove editors namespaces, elements and attributes
  21. * [ [ removeEmptyAttrs](https://github.com/svg/svgo/blob/master/plugins/removeEmptyAttrs.js) ] remove empty attributes
  22. * [ [ removeHiddenElems](https://github.com/svg/svgo/blob/master/plugins/removeHiddenElems.js) ] remove hidden elements
  23. * [ [ removeEmptyText](https://github.com/svg/svgo/blob/master/plugins/removeEmptyText.js) ] remove empty Text elements
  24. * [ [ removeEmptyContainers](https://github.com/svg/svgo/blob/master/plugins/removeEmptyContainers.js) ] remove empty Container elements
  25. * [ [ removeViewBox](https://github.com/svg/svgo/blob/master/plugins/removeViewBox.js) ] remove `viewBox` attribute when possible (disabled by default)
  26. * [ [ cleanUpEnableBackground](https://github.com/svg/svgo/blob/master/plugins/cleanupEnableBackground.js) ] remove or cleanup `enable-background` attribute when possible
  27. * [ [ minifyStyles](https://github.com/svg/svgo/blob/master/plugins/minifyStyles.js) ] minify `<style>` elements content with [CSSO](https://github.com/css/csso)
  28. * [ [ convertStyleToAttrs](https://github.com/svg/svgo/blob/master/plugins/convertStyleToAttrs.js) ] convert styles into attributes
  29. * [ [ convertColors](https://github.com/svg/svgo/blob/master/plugins/convertColors.js) ] convert colors (from `rgb()` to `#rrggbb`, from `#rrggbb` to `#rgb`)
  30. * [ [ convertPathData](https://github.com/svg/svgo/blob/master/plugins/convertPathData.js) ] convert Path data to relative or absolute whichever is shorter, convert one segment to another, trim useless delimiters, smart rounding and much more
  31. * [ [ convertTransform](https://github.com/svg/svgo/blob/master/plugins/convertTransform.js) ] collapse multiple transforms into one, convert matrices to the short aliases and much more
  32. * [ [ removeUnknownsAndDefaults](https://github.com/svg/svgo/blob/master/plugins/removeUnknownsAndDefaults.js) ] remove unknown elements content and attributes, remove attrs with default values
  33. * [ [ removeNonInheritableGroupAttrs](https://github.com/svg/svgo/blob/master/plugins/removeNonInheritableGroupAttrs.js) ] remove non-inheritable group's "presentation" attributes
  34. * [ [ removeUselessStrokeAndFill](https://github.com/svg/svgo/blob/master/plugins/removeUselessStrokeAndFill.js) ] remove useless stroke and fill attrs
  35. * [ [ removeUnusedNS](https://github.com/svg/svgo/blob/master/plugins/removeUnusedNS.js) ] remove unused namespaces declaration
  36. * [ [ cleanupIDs](https://github.com/svg/svgo/blob/master/plugins/cleanupIDs.js) ] remove unused and minify used IDs
  37. * [ [ cleanupNumericValues](https://github.com/svg/svgo/blob/master/plugins/cleanupNumericValues.js) ] round numeric values to the fixed precision, remove default 'px' units
  38. * [ [ cleanupListOfValues](https://github.com/svg/svgo/blob/master/plugins/cleanupListOfValues.js) ] round numeric values in attributes that take a list of numbers, like `viewBox` or `enableBackground`
  39. * [ [ moveElemsAttrsToGroup](https://github.com/svg/svgo/blob/master/plugins/moveElemsAttrsToGroup.js) ] move elements attributes to the existing group wrapper
  40. * [ [ moveGroupAttrsToElems](https://github.com/svg/svgo/blob/master/plugins/moveGroupAttrsToElems.js) ] move some group attributes to the content elements
  41. * [ [ collapseGroups](https://github.com/svg/svgo/blob/master/plugins/collapseGroups.js) ] collapse useless groups
  42. * [ [ removeRasterImages](https://github.com/svg/svgo/blob/master/plugins/removeRasterImages.js) ] remove raster images (disabled by default)
  43. * [ [ mergePaths](https://github.com/svg/svgo/blob/master/plugins/mergePaths.js) ] merge multiple Paths into one
  44. * [ [ convertShapeToPath](https://github.com/svg/svgo/blob/master/plugins/convertShapeToPath.js) ] convert some basic shapes to path
  45. * [ [ sortAttrs](https://github.com/svg/svgo/blob/master/plugins/sortAttrs.js) ] sort element attributes for epic readability (disabled by default)
  46. * [ [ transformsWithOnePath](https://github.com/svg/svgo/blob/master/plugins/transformsWithOnePath.js) ] apply transforms, crop by real width, center vertical alignment and resize SVG with one Path inside (disabled by default)
  47. * [ [ removeDimensions](https://github.com/svg/svgo/blob/master/plugins/removeDimensions.js) ] remove width/height attributes if viewBox is present (disabled by default)
  48. * [ [ removeAttrs](https://github.com/svg/svgo/blob/master/plugins/removeAttrs.js) ] remove attributes by pattern (disabled by default)
  49. * [ [ addClassesToSVGElement](https://github.com/svg/svgo/blob/master/plugins/addClassesToSVGElement.js) ] add classnames to an outer `<svg>` element (disabled by default)
  50. * [ [ removeStyleElement](https://github.com/svg/svgo/blob/master/plugins/removeStyleElement.js) ] remove `<style>` elements (disabled by default)
  51. Want to know how it works and how to write your own plugin? [Of course you want to](https://github.com/svg/svgo/blob/master/docs/how-it-works/en.md).
  52. ## How to use
  53. ```sh
  54. $ [sudo] npm install -g svgo
  55. ```
  56. ```
  57. Usage:
  58. svgo [OPTIONS] [ARGS]
  59. Options:
  60. -h, --help : Help
  61. -v, --version : Version
  62. -i INPUT, --input=INPUT : Input file, "-" for STDIN
  63. -s STRING, --string=STRING : Input SVG data string
  64. -f FOLDER, --folder=FOLDER : Input folder, optimize and rewrite all *.svg files
  65. -o OUTPUT, --output=OUTPUT : Output file or folder (by default the same as the input), "-" for STDOUT
  66. -p PRECISION, --precision=PRECISION : Set number of digits in the fractional part, overrides plugins params
  67. --config=CONFIG : Config file to extend or replace default
  68. --disable=DISABLE : Disable plugin by name
  69. --enable=ENABLE : Enable plugin by name
  70. --datauri=DATAURI : Output as Data URI string (base64, URI encoded or unencoded)
  71. -q, --quiet : Only output error messages, not regular status messages
  72. --pretty : Make SVG pretty printed
  73. --show-plugins : Show available plugins and exit
  74. Arguments:
  75. INPUT : Alias to --input
  76. OUTPUT : Alias to --output
  77. ```
  78. * with files:
  79. $ svgo test.svg
  80. or:
  81. $ svgo test.svg test.min.svg
  82. * with STDIN / STDOUT:
  83. $ cat test.svg | svgo -i - -o - > test.min.svg
  84. * with folder
  85. $ svgo -f ../path/to/folder/with/svg/files
  86. or:
  87. $ svgo -f ../path/to/folder/with/svg/files -o ../path/to/folder/with/svg/output
  88. * with strings:
  89. $ svgo -s '<svg version="1.1">test</svg>' -o test.min.svg
  90. or even with Data URI base64:
  91. $ svgo -s 'data:image/svg+xml;base64,…' -o test.min.svg
  92. * with SVGZ:
  93. from `.svgz` to `.svg`:
  94. $ gunzip -c test.svgz | svgo -i - -o test.min.svg
  95. from `.svg` to `.svgz`:
  96. $ svgo test.svg -o - | gzip -cfq9 > test.svgz
  97. * with GUI [svgo-gui](https://github.com/svg/svgo-gui)
  98. * as a web app - [SVGOMG](https://jakearchibald.github.io/svgomg/)
  99. * as a Nodejs module [examples](https://github.com/svg/svgo/tree/master/examples)
  100. * as a Grunt task [grunt-svgmin](https://github.com/sindresorhus/grunt-svgmin)
  101. * as a Gulp task [gulp-svgmin](https://github.com/ben-eb/gulp-svgmin)
  102. * as a Mimosa module [mimosa-minify-svg](https://github.com/dbashford/mimosa-minify-svg)
  103. * as an OSX Folder Action [svgo-osx-folder-action](https://github.com/svg/svgo-osx-folder-action)
  104. * as a webpack loader [image-webpack-loader](https://github.com/tcoopman/image-webpack-loader)
  105. ## Donate
  106. BTC `1zVZYqRSzQ4aaL27rp3PLwFFSXpfs5H8r`
  107. ## License and copyrights
  108. This software is released under the terms of the [MIT license](https://github.com/svg/svgo/blob/master/LICENSE).
  109. Logo by [Yegor Bolshakov](http://xizzzy.ru/).