Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@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 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 306,661 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.