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

hashvatar

v0.1.2

Published

Deterministic avatar generation from any hash string. Zero dependencies.

Readme

hashvatar

Deterministic avatars from any string — wallet address, username, UUID. Zero dependencies.

Two modes: gradient (radial blends) and dither (Bayer halftone + linear gradient).

npm install hashvatar

Demo

From the repo root, build then run the demo:

npm run build
npm run demo

Then open http://localhost:5000/demo/ in your browser. The demo loads the built bundle from dist/.


Usage

Vanilla JS

import { createHashvatar } from "hashvatar";

const { canvas, destroy } = createHashvatar({
	hash: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
	size: 64,
});

document.body.appendChild(canvas);

// Stop animation later if animated:
destroy();

React

import { Hashvatar } from 'hashvatar/react';

<Hashvatar hash="vitalik.eth" size={48} />
<Hashvatar hash="satoshi" size={64} mode="dither" />
<Hashvatar hash="0x742…44e" size={64} animated tones={['hotpink', '#00ff99']} />

React is an optional peer dependency — only install it if you use hashvatar/react.


Options

| Option | Type | Default | Description | | ---------- | ------------------------ | ------------ | --------------------------------------------------------------------- | | hash | string | — | Any string. Same string = same avatar. | | size | number | 64 | Canvas size in px (square). | | mode | 'gradient' \| 'dither' | 'gradient' | Render style. | | animated | boolean | false | Animation loop. | | dotScale | number | — | Dither cell size. If omitted, scales with canvas for consistent look. | | tones | string[] | — | Restrict palette (hex, oklch(), CSS color names). |

createHashvatar(options) — returns { canvas, colors, destroy }.

renderHashvatar(canvas, options) — draws into an existing canvas; returns destroy().

hashToColors(hash, tones?, count?) — returns the generated OKLCH colors without rendering.

hashToSeeds(hash, count) — returns count deterministic numbers in [0, 1) from the hash (for custom rendering or seeding).


Circle / clipping

The canvas is square. To show a circle:

canvas {
	border-radius: 50%;
}

The React component already uses border-radius: 50% by default. You can also use a rounded square, hexagon via clip-path, etc.


Tone constraints

// Single hue family
createHashvatar({ hash, tones: ["hotpink"] });

// Multiple
createHashvatar({ hash, tones: ["#ff6b6b", "#4ecdc4"] });

// oklch
createHashvatar({ hash, tones: ["oklch(0.65 0.25 310)"] });

Development

npm install
npm run build    # ESM + CJS + types (tsup)
npm run dev      # watch & rebuild
npm run demo     # serve on port 5000

Publish

npm run build
npm publish

MIT — Médhy · repo