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

polyicon

v0.1.5

Published

SVG to icon font generator with HTML preview — Fontello-style output for React and web projects.

Readme

Polyicon

SVG to icon font generator with HTML preview — Fontello-style output for React and web projects.

Converts a folder of SVGs into woff2, woff, ttf, eot, svg font files plus a CSS file, a TypeScript/JS types file, and an interactive HTML preview page.

Install

# project dev dependency
npm i -D polyicon

# or global
npm i -g polyicon

# or one-off
npx polyicon init

Quick Start

polyicon init      # creates .polyiconrc with defaults
polyicon generate  # builds fonts, CSS, types, and preview

Place your SVGs in the folder specified by svg in .polyiconrc, then run generate. Output folders are created automatically.

Config (.polyiconrc)

{
  "svg": "./src/assets/svg",
  "outputFonts": "./src/assets/fontello/font",
  "outputStyles": "./src/assets/fontello/css/polyicon.css",
  "outputTypes": "./src/types/IconTypes.js",
  "polyiconConfig": "./src/assets/fontello/config.json",
  "importFontsPath": "../font/",
  "formats": ["eot", "svg", "ttf", "woff", "woff2"]
}

| Field | Required | Description | |---|---|---| | svg | ✓ | Folder containing your .svg files | | outputFonts | ✓ | Where font files are written | | outputStyles | | CSS file output path | | outputTypes | ✓ | JS or TS types file output path | | polyiconConfig | | Fontello-compatible config.json output path | | importFontsPath | | Font URL prefix in the generated CSS (e.g. ../font/) | | formats | | Font formats to generate (default: all five) |

SVG filenames become CSS class names. Spaces and special characters are auto-sanitised to hyphens. Use clean, single-colour SVGs — icon fonts are monochrome.

Output

src/assets/fontello/
  polyicon-preview.html   ← interactive icon browser
  css/
    polyicon.css
  font/
    polyicon.eot
    polyicon.svg
    polyicon.ttf
    polyicon.woff
    polyicon.woff2
  config.json
src/types/
  IconTypes.js

Open polyicon-preview.html in a browser to browse all generated icons, search by name, and click any card to copy its class name to the clipboard.

Usage in React

Import the generated CSS once (e.g. in your root component or entry file):

import "./assets/fontello/css/polyicon.css";

Use icons by class name:

<i className="polyicon polyicon-home" />

Or with the generated types for autocomplete:

import IconTypes from "./types/IconTypes";

<i className={`polyicon polyicon-${IconTypes.HOME}`} />

Programmatic API

const { buildIcons } = require("polyicon");

await buildIcons({
  svg: "./src/assets/svg",
  outputFonts: "./dist/fonts",
  outputStyles: "./dist/polyicon.css",
  outputTypes: "./src/types/IconTypes.js",
  importFontsPath: "./fonts/",
  formats: ["woff2", "woff", "ttf"]
});

CLI

polyicon init       Create .polyiconrc
polyicon generate   Generate fonts, CSS, types, and preview

Options:
  -c, --config   Path to config (default: .polyiconrc)
  -f, --force    Overwrite config on init