Socket
Book a DemoInstallSign in
Socket

svgo-unique-id

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svgo-unique-id

If you are inlining SVGs on a web page, and they use `id`s internally, these `id` attributes must be unique across the entire page. This problem is exacerbated if you are using svgo to minify those `id`s. svgo-unique-id is a plugin for svgo that automatic

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
38
-5%
Maintainers
1
Weekly downloads
 
Created
Source

svgo-unique-id

If you are inlining SVGs on a web page, and they use ids internally, these id attributes must be unique across the entire page. This problem is exacerbated if you are using svgo to minify those ids. svgo-unique-id is a plugin for svgo that automatically prefixes the ids with a short hash of the contents of the entire svg. This hash is stable, and very unlikely not to be unique.

Installation

yarn add svgo-unique-id

Usage

new SVGO({
  plugins: [{
    uniqueID: require('svgo-unique-id'),
  }]
})

License

MIT

FAQs

Package last updated on 09 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts