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 🙏

© 2025 – Pkg Stats / Ryan Hefner

iconfont-compiler

v0.4.0

Published

Compile .iconfont file to icon fonts(.svg, .ttf, .eot, .woff, .woff2, .css, .html)

Readme

IconFont Compiler

Compile .iconfont file to icon fonts(.svg, .ttf, .eot, .woff, .woff2, .css, .html)

How to use

  1. Create a icon.iconfont file:
<?xml version="1.0" encoding="utf-8"?>
<iconfont fontName="" startUnicode="59907" classNamePrefix="my-icon">
	<svg src="*.svg"></svg>
</iconfont>

Then copy all the .svg icons to the same directory of icon.iconfont

You can add some attributes to <svg> nodes:

  • name: The name of icon
  • unicode: The unicode string of icon
  • class: The css class name of icon
  • title: Readable title of icon

For example:

<svg name="warning" unicode="⚠" class="warning" viewBox="0 0 1034 1024">
	<path d="M1011.982 842.518 606.673 140.565c-49.575-85.822-130.595-85.822-180.157 0L21.205 842.518c-49.562 85.91-9.015 155.99 90.04 155.99l810.693 0C1020.997 998.507 1061.502 928.423 1011.982 842.518zM460.924 339.737c14.565-15.747 33.082-23.622 55.665-23.622 22.595 0 41.095 7.792 55.675 23.307 14.485 15.55 21.725 34.997 21.725 58.382 0 20.12-30.235 168.07-40.32 275.704l-72.825 0c-8.845-107.635-41.652-255.584-41.652-275.704C439.194 374.774 446.446 355.407 460.924 339.737zM571.244 851.538c-15.32 14.92-33.55 22.355-54.65 22.355-21.095 0-39.33-7.435-54.647-22.355-15.275-14.885-22.867-32.915-22.867-54.09 0-21.065 7.592-39.29 22.867-54.565 15.317-15.28 33.552-22.92 54.647-22.92 21.1 0 39.33 7.64 54.65 22.92 15.265 15.275 22.875 33.5 22.875 54.565C594.119 818.623 586.509 836.653 571.244 851.538z"></path>
</svg>
  1. Generate all files using compiler api
import { compileIconFont } from "iconfont-compiler"
import { readFileSync, writeFileSync } from "fs"

const result = await compileIconFont(readFileSync("icon.iconfont", "utf-8"), "icon.iconfont")
writeFileSync(`./dist/iconfont.svg`, result.svg)
writeFileSync(`./dist/iconfont.ttf`, result.ttf)
writeFileSync(`./dist/iconfont.eot`, result.eot)
writeFileSync(`./dist/iconfont.woff`, result.woff)
writeFileSync(`./dist/iconfont.woff2`, result.woff2)
writeFileSync(`./dist/iconfont.css`, result.css)
writeFileSync(`./dist/iconfont.html`, result.html)