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

@iconoma-icons/core

v1.0.0

Published

Core generation engine for Iconoma — deterministic SVG icon generator.

Downloads

12

Readme

@iconoma-icons/core

Core engine for Iconoma — deterministic SVG icon generation from any string.

Install

npm install @iconoma-icons/core

You'll also want @iconoma-icons/collection for the built-in styles, unless you're writing your own.

API

createIcon(style, options?)

Generates a deterministic SVG icon from a style function and options.

import { createIcon } from '@iconoma-icons/core';
import { pixel } from '@iconoma-icons/collection';

const icon = createIcon(pixel, {
  seed: '[email protected]',
  size: 128,
  colors: ['#FF006E', '#8338EC', '#3A86FF', '#FFBE0B', '#FB5607'],
  isCircle: false,
  borderRadius: 0,
});

icon.toString();   // '<svg xmlns="http://www.w3.org/2000/svg" ...>...</svg>'
icon.toDataUri();  // 'data:image/svg+xml;charset=utf-8,%3Csvg...'

Returns: Result — an object with two methods:

| Method | Returns | Description | |--------|---------|-------------| | toString() | string | Raw SVG markup. Use with innerHTML, fs.writeFileSync(), etc. | | toDataUri() | string | Data URI string. Use with <img src="..."> or CSS background-image. |

Options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | seed | string | random | Any string. Determines the icon appearance. Same seed = same icon. | | size | number | 128 | Width & height in pixels. | | colors | string[] | ['#FF006E', '#8338EC', '#3A86FF', '#FFBE0B', '#FB5607'] | Array of hex color strings (e.g. '#FF006E'). 3-5 colors recommended. | | isCircle | boolean | false | Clip to circle via SVG <clipPath>. | | borderRadius | number | 0 | Rounded corner radius in px. Ignored if isCircle is true. | | styleOptions | Record<string, any> | style defaults | Style-specific tuning params. See @iconoma-icons/collection docs for options per style. |

SeededRandom

Deterministic pseudo-random number generator. Used internally and exposed for custom styles.

import { SeededRandom } from '@iconoma-icons/core';

const rng = new SeededRandom(42);

rng.random();              // float in [0, 1)
rng.randomInt(0, 10);      // integer in [0, 10] inclusive
rng.randomElement(array);  // picks one element
rng.shuffle(array);        // Fisher-Yates shuffle, returns the shuffled array

Style type

A style is a function with this signature:

type Style = (rng: SeededRandom, options: Options) => string;

It receives a seeded RNG and the resolved options, and returns an SVG body string (the markup inside the <svg> tag — rects, paths, polygons, etc). The createIcon function wraps this in a proper SVG element with viewBox, clipping, etc.

Writing a custom style

import { createIcon, SeededRandom } from '@iconoma-icons/core';
import type { Style, Options } from '@iconoma-icons/core';

const myStyle: Style = (rng: SeededRandom, options: Options): string => {
  const size = options.size || 128;
  const colors = options.colors || ['#000', '#fff'];
  const bg = rng.randomElement(colors);
  const fg = rng.randomElement(colors);

  // Return SVG body markup (everything inside <svg>)
  return `
    <rect width="${size}" height="${size}" fill="${bg}"/>
    <circle cx="${size/2}" cy="${size/2}" r="${size/3}" fill="${fg}"/>
  `;
};

const icon = createIcon(myStyle, { seed: 'hello', size: 256 });
console.log(icon.toString());

License

MIT