npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iconsync/core

v0.0.3

Published

IconSync – Sync Figma icons and generate optimized React components.

Downloads

32

Readme

@iconsync/core

A powerful tool for synchronizing Figma icons with your codebase. Fetch icons from Figma and generate React components automatically.

Documentation

Documentation

For full documentation, visit https://iconsync-docs.vercel.app/

Installation

# npm
npm install @iconsync/core

# yarn
yarn add @iconsync/core

# pnpm
pnpm add @iconsync/core

Usage

1. Create a configuration file

Create an icon.config.ts file in your project root:

import { iconConfig } from "@iconsync/core";

export default iconConfig({
  figma: {
    token: process.env.FIGMA_TOKEN!, // Your Figma API token
    url: "https://www.figma.com/design/YOUR_FILE_ID/YOUR_FILE_NAME?node-id=YOUR_NODE_ID",
    // Alternatively, you can specify fileId and nodeId directly:
    // fileId: "YOUR_FILE_ID",
    // nodeId: "YOUR_NODE_ID",
  },
  fetch: {
    concurrentDownloads: 5, // Number of concurrent downloads
    // Optional configurations:
    // nodeTypes: ["COMPONENT", "COMPONENT_SET"], // Types of nodes to fetch
    // generateFileName: (node, parentNode) => node.name + "--" + parentNode.name, // Custom filename generator
    // sanitizeName: true, // Sanitize filenames
    // limit: 10, // Limit the number of icons to fetch
  },
  generator: {
    icon: true, // Generate icon components
    typescript: true, // Generate TypeScript files
    titleProp: true, // Add title prop to components
    dimensions: false, // Include width/height dimensions
    expandProps: "end", // Position of expanded props
    replaceAttrValues: {
      "#000000": "currentColor", // Replace specific colors
      "#fff": "currentColor",
    },
    outDir: "src/components/icons", // Output directory
    ext: "tsx", // File extension
    prettier: true, // Format with Prettier
    memo: false, // Use React.memo
    ref: false, // Forward refs
    filenameCase: "camel", // Filename case style: "pascal", "camel", "kebab", "snake"
  },
});

2. Add scripts to your package.json

{
  "scripts": {
    "icon:fetch": "iconsync fetch",
    "icon:cache:stats": "iconsync cache:stats",
    "icon:cache:clear": "iconsync cache:clear",
    "icon:generate": "iconsync generator"
  }
}

3. Set up your Figma token

Create a .env file and add your Figma token:

FIGMA_TOKEN=your_figma_api_token

4. Run the commands

# Fetch icons from Figma
npm run icon:fetch

# Generate React components
npm run icon:generate

# View cache statistics
npm run icon:cache:stats

# Clear the cache
npm run icon:cache:clear

API Reference

iconConfig(options)

The main configuration function that accepts the following options:

figma

  • token: Your Figma API token
  • url: Figma file URL with node ID
  • fileId: Figma file ID (alternative to URL)
  • nodeId: Figma node ID (alternative to URL)

fetch

  • concurrentDownloads: Number of concurrent downloads
  • nodeTypes: Types of nodes to fetch (default: ["COMPONENT", "COMPONENT_SET"])
  • generateFileName: Custom filename generator function
  • sanitizeName: Whether to sanitize filenames (default: true)
  • limit: Limit the number of icons to fetch

generator

  • icon: Generate icon components (default: true)
  • typescript: Generate TypeScript files (default: true)
  • titleProp: Add title prop to components (default: true)
  • dimensions: Include width/height dimensions (default: false)
  • expandProps: Position of expanded props (default: "end")
  • replaceAttrValues: Object mapping colors to replace
  • outDir: Output directory for generated components
  • ext: File extension for generated components (default: "tsx")
  • prettier: Format with Prettier (default: true)
  • memo: Use React.memo (default: false)
  • ref: Forward refs (default: false)
  • filenameCase: Filename case style (default: "camel")

CLI Commands

  • iconsync fetch: Fetch icons from Figma
  • iconsync generator: Generate React components from fetched icons
  • iconsync cache:stats: View cache statistics
  • iconsync cache:clear: Clear the cache

License

MIT