Socket
Socket
Sign inDemoInstall

@iconify/utils

Package Overview
Dependencies
6
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iconify/utils


Version published
Weekly downloads
428K
decreased by-7.22%
Maintainers
1
Created
Weekly downloads
 

Package description

What is @iconify/utils?

@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.

What are @iconify/utils's main functionalities?

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);

Other packages similar to @iconify/utils

Readme

Source

Iconify Utils

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.

Installation

To install the library run this command:

npm install @iconify/utils --save

Documentation

Documentation is available at Iconify documentation website.

License

The library is released with MIT license.

© 2021 - 2022 Vjacheslav Trushkin / Iconify OÜ

FAQs

Last updated on 16 Dec 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc