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

iconfontlibrary

v1.4.0

Published

A Node based utility that packs svg icons into a font file of different formats such as ttf, woff, woff2 and more.

Downloads

662

Readme

iconfontlibrary

A Node.js utility that packs SVG icons into OTF font files with ligature support. Drop in your SVGs, get a font file and ready-to-use CSS/SCSS/JS/TS bindings. Ligatures are automatically inferred from your SVG file names.

Installation

npm install iconfontlibrary

Quick Start

import { IconFontLibrary } from 'iconfontlibrary';

const library = new IconFontLibrary({
  familyName: 'MyIcons',
  svgDirectories: ['./icons'],
  outputDirectory: './fonts'
});

library.generateToFile();

This reads all .svg files from ./icons and writes the following to ./fonts:

| File | Description | | --------------------- | -------------------------------------- | | MyIcons.otf | The font file | | MyIcons.css | CSS with @font-face and icon classes | | MyIcons.module.scss | SCSS module with icon variables | | MyIcons.mjs | ESM icon map | | MyIcons.cjs | CJS icon map | | MyIcons.ts | TypeScript icon map with types | | MyIcons.json | JSON icon map |

Bundler Plugins

This library has support for all major bundlers via unplugin. The plugins generate the font on build start and automatically regenerate when .svg files change (add, update, remove).

Vite

import { vitePlugin } from 'iconfontlibrary';

export default defineConfig({
  plugins: [
    vitePlugin({
      familyName: 'MyIcons',
      svgDirectories: ['./icons'],
      outputDirectory: './fonts'
    })
  ]
});

Webpack

import { webpackPlugin } from 'iconfontlibrary';

module.exports = {
  plugins: [
    webpackPlugin({
      familyName: 'MyIcons',
      svgDirectories: ['./icons'],
      outputDirectory: './fonts'
    })
  ]
};

Rollup

import { rollupPlugin } from 'iconfontlibrary';

export default {
  plugins: [
    rollupPlugin({
      familyName: 'MyIcons',
      svgDirectories: ['./icons'],
      outputDirectory: './fonts'
    })
  ]
};

esbuild

import { esbuildPlugin } from 'iconfontlibrary';
import esbuild from 'esbuild';

esbuild.build({
  plugins: [
    esbuildPlugin({
      familyName: 'MyIcons',
      svgDirectories: ['./icons'],
      outputDirectory: './fonts'
    })
  ]
});

Options

All options are shared between IconFontLibrary and the bundler plugins.

| Option | Type | Default | Description | | ------------------- | -------------------- | ---------------------- | ---------------------------------------------------- | | familyName | string | required | Font family name | | svgDirectories | string[] | required | Directories containing SVG files | | outputDirectory | string | required | Where to write the output files | | ascender | number | 800 | Font ascender value | | className | string | familyName | CSS class name used in selectors | | descender | number | -200 | Font descender value | | unitsPerEm | number | 1000 | Font units per em | | styleName | string | 'Regular' | Font style name | | ligatures | boolean | true | Enable ligature support (icon name as ligature text) | | recursive | boolean | false | Scan SVG directories recursively | | unicodeAssignment | IUnicodeAssignment | { strategy: 'auto' } | Unicode codepoint assignment strategy |

Unicode Assignment

By default, codepoints are auto-assigned starting from the Private Use Area (U+E000). You can customize the starting point or provide a manual mapping:

// Auto-assign starting from a custom codepoint
{ strategy: 'auto', startCodePoint: 0xf000 }

// Manual mapping
{ strategy: 'manual', mapping: { home: 0xe001, search: 0xe002 } }

Programmatic API

If you need the font buffer without writing to disk, use generate():

const result = library.generate();

result.fontBuffer; // ArrayBuffer — the OTF font data
result.glyphNames; // string[] — names of all generated glyphs
result.unicodeMap; // Record<string, number> — icon name → unicode codepoint