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

react-icon-generator-cli

v1.2.2

Published

A fully typed, tree-shakable React icon library built with react-icon-generator-cli.

Readme

React Icon Generator CLI

React Icon Generator CLI is a lightweight, high-performance tool that automates the conversion of SVG and PNG assets into fully typed, tree-shakable React components.

Stop manually converting SVGs. Point this CLI to your assets folder, and get a production-ready icon library in seconds.

🚀 Key Features

  • ⚡️ Instant Conversion: Transforms .svg and .png files into optimized React components.
  • 📦 Smart Caching: Only rebuilds changed files to keep your build process fast.
  • 🎨 Visual Preview: Generates a preview.html to easily browse your icon set.
  • 📘 TypeScript Support: Includes built-in type definitions (.d.ts) and fully typed props.
  • 🧩 Zero Configuration: Works out-of-the-box with sensible defaults (Prettier included).
  • 🗂 Structured Output: Creates an iconPack with an index barrel file and a dynamic map.

📦 Installation

Method 1: Run via npx (Recommended)

npx react-icon-generator-cli ./path/to/icons

Method 2: Install as Dev Dependency

# npm
npm install --save-dev react-icon-generator-cli

# yarn
yarn add --dev react-icon-generator-cli

# bun
bun add -d react-icon-generator-cli

Add a script to your package.json:

"scripts": {
  "generate:icons": "react-icon-generator-cli ./assets/svgs"
}

🛠 Usage

  1. Organize your assets

Place your icon files in a directory. Recommended: kebab-case or PascalCase.

/assets/icons
├── user-profile.svg
├── settings.svg
└── notification-bell.png
  1. Run the command
npx react-icon-generator-cli ./assets/icons
  1. Generated Structure
iconPack/
├── icons/               # ⚛️ Individual React Components
│   ├── IconUserProfile.tsx
│   ├── IconSettings.tsx
│   └── IconNotificationBell.tsx
├── index.ts             # 📤 Barrel file for named exports
├── iconMap.ts           # 🗺 Object mapping keys to components
└── preview.html         # 👁 Open in browser to view icons

💻 Implementation in React

Direct Import (Recommended)

import { IconUserProfile, IconSettings } from './iconPack';

const NavBar = () => {
  return (
    <nav>
      <IconUserProfile width={24} height={24} className="text-blue-500" />
      <IconSettings style={{ color: 'red' }} />
    </nav>
  );
};

Dynamic Import (Using IconMap)

import { iconMap } from './iconPack/iconMap';

type IconName = keyof typeof iconMap;

const MenuItem = ({ iconName }: { iconName: IconName }) => {
  const Icon = iconMap[iconName];
  if (!Icon) return null;
  return (
    <div className="menu-item">
      <Icon width="20" height="20" />
    </div>
  );
};

⚙️ Requirements

  • Node.js: v18.0.0 or higher
  • Works best with React + TypeScript projects (Next.js, Vite, CRA).

🤝 Contributing

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.