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

@neptune3d/icon-font

v0.0.15

Published

Library for creating icon fonts with composition.

Readme

@neptune3d/icon-font

Library for creating icon fonts with composition.

NPM Version

npm install @neptune3d/icon-font

ℹ️ Note: When installing you might get an error like this: error: install script from "ttf2woff2" exited with 1 - should be fine, if not, just try running install again.

Example

import { IconPath, IconGlyph, IconFont } from "@neptune3d/icon-font";

// all of the paths are in a 24x24 design space ( which is the default )

// a filled file path with a dog ear in the top right corner
const textFilePath = new IconPath(24).rect({
  x: 0,
  y: 0,
  width: 24,
  height: 19,
  corners: {
    tr: { kind: "chamfer", rx: 6, ry: 6 },
  },
});

// a template path for a text line - a basic rectangle with sharp corners
const textLinePath = new IconPath().rect({ x: 0, y: 0, width: 15, height: 2 });

// three text line paths merged into one IconPath
// one below the other
const textLinesPath = IconPath.merge([
  textLinePath.clone().translate(4, 8),
  textLinePath.clone().translate(4, 12),
  textLinePath.clone().translate(4, 16),
]).center(0, 0, 24, 19); // centered in the bounding box of the text file path

// create the font
const myIconFont = new IconFont({
  familyName: "myIcons",
  prefix: "mi", // css class prefix
  icons: [
    new IconGlyph({
      name: "text-file",
      unicode: 0xe001, // first unicode in the PUA ( Private Use Area )
      path: IconPath.merge([textFilePath, textLinesPath]).center(),
    }),
  ],
});

// write woff2 and css files
await Promise.all([
  writeFile(`../public/${myIconFont.familyName}.woff2`, myIconFont.toWoff2()),
  writeFile(
    "../src/icons.css",
    myIconFont.toCss(`/${myIconFont.familyName}.woff2`)
  ),
]);

// use the icon
import "./icons.css";

<div class="mi mi-text-file" style="font-size: 24px; color: #fff;"></div>;

Browser support

When using this library in the browser with vite ( e.g. for previewing the font in the canvas ), you might get a console error like this:

Uncaught sync fetching of the wasm failed: you can preload it to Module["wasmBinary"] manually, or emcc.py will do that for you when generating HTML (but not JS)

The error comes from the ttf2woff2 dependency of this package and you solve it by stubbing out the ttf2woff2 module:

// create a stub file src/ttf2woff2-stub.js:
export default {};

// and have these fields in the vite config:
import { defineConfig } from "vite";

export default defineConfig({
  resolve: {
    alias: {
      ttf2woff2: "./src/ttf2woff2-stub.js",
    },
  },
  optimizeDeps: {
    force: true,
    include: ["@neptune3d/icon-font"],
  },
});

Of course, this means you won't be able to use the ttf2woff2 features ( IconFont.toWoff2() ) in the browser, but you probably don't need it in the browser anyway.