Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

svg-unique

jpfiorilla11ISC0.1.1

Rewrite a set of svg files with unique ids so they don't override each other on webpages.

svg, unique

readme

Edit your SVGs to have unique markup

Programs like Sketch output their .svg files with the same ids as each other by default, which causes the svgs to override each other's markup when multiple are displayed on a webpage.

This script solves this issue by renaming the id and class attributes of all SVG elements to be unique.

Install:

$ npm i -g svg-unique

Use:

$ svgu

or

$ svgu --input=./customInputDir --output=./customOutputDir

Argument Use Default value
--input Custom input directory .
--output Custom output directory --input