SVG manipulation with 'svgo'

Mar 5, 2016 using tags svg

npm install svgo

svgo is a very useful tool for (in my case) very basic svg manipulation. It removes extra inkscape cruft and outputs a “minified” svg of sorts:

svgo --pretty icon_79124.svg


<svg xmlns="" width="100" height="100" viewBox="0 0 100 100">
  <g stroke="#000" stroke-width="8" stroke-linecap="round" stroke-miterlimit="10" fill="none">
    <path d="M49.942 49.843L34.896 34.865M49.942 49.887L64.896 34.91M49.942 49.887l14.953 14.978M49.942 49.887L34.99 64.864"/>
  <circle stroke="#000" stroke-width="8" stroke-miterlimit="10" cx="50" cy="49.917" r="39.833" fill="none"/>

Which can be easily copy/pasted directly into an html file!

(original source)