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

bit-icon

v0.1.2

Published

A GitHub-like identicon. SVG and PNG support.

Readme

bit-icon

Generate 8-bit style icons like the initial GitHub icons. SVG and PNG support.

bit-icon-demo-image

Demo

You can try it here.

Installation

npm install bit-icon

Methods

| Name | Type | Description | Example | | ------- | ----------------- | ------------------------------------ | -------------------------------------- | | toSvg() | string | Output Base64-encoded SVG in DataURI | data:image/svg+xml;base64,PHN2Zz ... | | toPng() | Promise<string> | Output Base64-encoded PNG in DataURI | data:image/png;base64,iVBORw0KGU ... |

Options

| Name | Type | Default | Description | | ---------- | -------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | hash | string | | A hexadecimal string of 22 or more characters used to generate image.If none, it is randomly generated. | | size | number | 420 | The width and height of the image to be generated. | | pixel | number | 70 | The size of a single pixel of the icon to be generated.Note that the pixel should be no larger than 1/5 of the size to avoid overflowing. | | color | string | | The color of the icon is calculated from the hash value. Use this option to disable that behavior and use the specified color instead. Use Hex,RGB,HSL,HSB. (e.g. #FF0000 or rgb(255,0,0) or hsl(0,100,50) or rgb(0,100,100) for red). | | background | string | #FFFFFF | Used as the background color of the generated image; use Hex,RGB,HSL,HSB. (e.g. #FF0000 or rgb(255,0,0) or hsl(0,100,50) or rgb(0,100,100) for red). | | hue | number[] | [0,360] | Used as a range of hue in HSL colors calculated from the hash. | | saturation | number[] | [45,65] | Used as a range of saturation in HSL colors calculated from the hash. | | lightness | number[] | [55,75] | Used as a range of lightness in HSL colors calculated from the hash. | | type | 'normal' | 'reverse'| 'random' | "normal" | It is used to fill in the color of the image to be generated. "normal" has a white background and colored body. "reverse" is the reverse of "normal". "random" is just as the name implies. |

Usage

import

import  { BitIcon }  from "bit-icon";

Simple

const bitIcon = new BitIcon();
const svg = bitIcon.toSvg();

// If you use it in HTML
const img = document.createElement('img');
img.src = svg;
document.body.appendChild(img);

Custom

import  { BitIcon, Options }  from "bit-icon";

// Must be at least 22 characters in hexadecimal, such as MD5.
const hash = 'd41d8cd98f00b204e9800998ecf8427e'
const options: Options = {
    size: 100,
    pixel: 15,
    color: "hsl(215,25,27)",
    background: "hsl(214,32,91)",
    hue: [100, 300],
    saturation: [10, 70],
    lightness: [20, 80],
    type: 'reverse'
  };
const bitIcon = new BitIcon(hash, options);
const png = await bitIcon.toPng();

// If you want to download
const link = document.createElement('a');
link.download = 'sample.png';
link.href = png;
link.click();