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

@pokedotdev/iconify

v0.3.0

Published

`@pokedotdev/iconify` is a small Bun-based build tool that converts SVG icon collections into Iconify-style JSON bundles.

Readme

iconify

@pokedotdev/iconify is a small Bun-based build tool that converts SVG icon collections into Iconify-style JSON bundles.

It scans svgs/, discovers icon set directories automatically, normalizes SVGs with @iconify/tools, and writes the generated output to json/. The published package contains only encrypted collections (json/*.json.enc) plus a dependency-free postinstall that decrypts them with ICONIFY_KEY.

What It Does

For each discovered icon set, the generator:

  • imports SVG files from svgs/<set>
  • cleans and optimizes SVG markup
  • converts non-empty colors to currentColor
  • exports a single json/<prefix>.json bundle

Project Layout

src/index.ts      Main generator
icon-sets.json    Optional prefix alias configuration
svgs/             Source SVG collections
json/             Generated output files

Install

bun install

Generate Icon Sets

bun run src/index.ts

This clears json/ first, rescans svgs/, and regenerates every output file.

Source Directory Conventions

Directories inside svgs/ become icon-set paths. By default, path segments are joined with -:

  • svgs/iconic -> json/iconic.json
  • svgs/fa/solid -> json/fa-solid.json

If a directory contains .svg files, it is treated as a leaf set and subdirectories under it are not scanned further.

Aliases

Use icon-sets.json to override generated prefixes. Aliases are optional; this package currently ships with no active aliases configured.

Exact aliases:

{
	"aliases": {
		"iconic": "iconic"
	}
}

Pattern aliases with placeholders:

{
	"aliases": {
		"fa/brands": "fa-brand",
		"fa/duotone-{weight}": "fa-duo-{weight}",
		"fa/{set}-duotone-{weight}": "fa-{set}-duo-{weight}"
	}
}

Verification

Before committing logic changes, run:

bunx tsc --noEmit
bun run src/index.ts
git diff -- json

Keep generator changes and regenerated json/ output in separate commits when practical.

Encrypted Distribution

The package is public, but the Font Awesome Pro icon data is not: every json/<prefix>.json is gzipped and encrypted with AES-256-GCM (random IV per file, auth tag stored, file name bound as AAD) into json/<prefix>.json.enc. The tarball contains no plaintext icon data. On install, scripts/postinstall.mjs (node:crypto only) reads ICONIFY_KEY (32 bytes, base64 or hex) and writes json/<prefix>.json next to the .enc files. Without a key, or with a wrong one, it prints a one-line error and exits 1. It never prints the key.

Consumers need ICONIFY_KEY set in the environment at install time.

Publish

The key lives in ~/.config/iconify/key (mode 600) or in ICONIFY_KEY.

bun test
bun run encrypt          # json/*.json -> json/*.json.enc (run again after regenerating icons)
npm pack --dry-run       # must list only json/*.json.enc, scripts/*.mjs, package.json, README.md
npm publish

Always run bun run encrypt before packing: files only whitelists .enc files, so a stale or missing set would publish old or no icons. Unpack the tarball and check that it has no plaintext before publishing.

Rotate the key

Published versions stay public forever, so a leaked key exposes every version encrypted with it. To rotate: generate a new key (node -e 'console.log(require("crypto").randomBytes(32).toString("base64"))'), save it to ~/.config/iconify/key, run bun run encrypt, publish a new version, and move consumers to it with the new ICONIFY_KEY. Old versions remain decryptable with the old key.

pnpm 10+

pnpm 10+ does not run dependency lifecycle scripts by default. Allow this package to build, otherwise postinstall is skipped and json/*.json is never created (onlyBuiltDependencies / pnpm approve-builds):

{ "pnpm": { "onlyBuiltDependencies": ["@pokedotdev/iconify"] } }

pnpm 8 runs the script without extra configuration. Also make sure ignore-scripts is not enabled.