Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@iconify/utils
Advanced tools
Common functions for working with Iconify icon sets used by various packages.
@iconify/utils is a utility package for working with Iconify icons. It provides various tools for managing, customizing, and converting icon data, making it easier to integrate and manipulate icons in your projects.
Icon Data Management
This feature allows you to retrieve icon data for a specific icon. The `getIconData` function takes an icon name as an argument and returns the corresponding icon data.
const { getIconData } = require('@iconify/utils');
const iconData = getIconData('mdi:home');
console.log(iconData);
Icon Customization
This feature allows you to customize SVG content by replacing IDs to avoid conflicts. The `replaceIDs` function takes SVG content as an argument and returns the modified SVG content with unique IDs.
const { replaceIDs } = require('@iconify/utils');
const svgContent = '<svg><path id="icon" d="..."/></svg>';
const customizedSVG = replaceIDs(svgContent);
console.log(customizedSVG);
Icon Conversion
This feature allows you to convert icon data to SVG format. The `iconToSVG` function takes icon data as an argument and returns the corresponding SVG content.
const { iconToSVG } = require('@iconify/utils');
const iconData = { body: '<path d="..."/>', width: 24, height: 24 };
const svg = iconToSVG(iconData);
console.log(svg);
svg-sprite is a package for creating SVG sprites. It allows you to combine multiple SVG files into a single sprite, which can be used to optimize the delivery of SVG icons. Compared to @iconify/utils, svg-sprite focuses more on sprite generation rather than individual icon manipulation.
svgo is a tool for optimizing SVG files. It provides various plugins to compress and clean up SVG content, making it more efficient for web use. While @iconify/utils offers icon-specific utilities, svgo is more general-purpose and focuses on SVG optimization.
icon-gen is a package for generating icons for various platforms (e.g., favicon, iOS, Android) from a single source image. It is useful for creating platform-specific icons, whereas @iconify/utils is more focused on managing and customizing icon sets.
This is a set of helper functions that deal with Iconify icon sets.
Functions are split into a separate library because they are reused in many projects.
To install the library run this command:
npm install @iconify/utils --save
Documentation is available at Iconify documentation website.
The library is released with MIT license.
© 2021 - 2022 Vjacheslav Trushkin / Iconify OÜ
FAQs
Common functions for working with Iconify icon sets used by various packages.
The npm package @iconify/utils receives a total of 492,085 weekly downloads. As such, @iconify/utils popularity was classified as popular.
We found that @iconify/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.