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

avataurus

v1.0.1

Published

Deterministic avatar generator — unique minimal face avatars from any string. Zero dependencies, pure SVG math.

Downloads

208

Readme

Avataurus

Minimal face avatars from pure math

npm version bundle size license CI

Deterministic · Zero Dependencies · 4KB gzipped

Try it live →


Feed it any string, get back a unique minimal face avatar. Same input, same face — forever. Pure SVG generated from deterministic math, no network requests, no database.

Install

npm i avataurus

Or use a CDN:

<!-- unpkg -->
<script type="module" src="https://unpkg.com/avataurus/src/element.js"></script>

<!-- jsdelivr -->
<script type="module" src="https://cdn.jsdelivr.net/npm/avataurus/src/element.js"></script>

Usage

Image URL — point an <img> at the service

<img src="https://avataurus.com/your-username" width="64" height="64" alt="Avatar" />

Query params: ?size=128&variant=initial

Web Component — drop in an <avataurus>

<script type="module">
  import 'avataurus/element'
</script>

<avataurus seed="jane" size="64"></avataurus>
<avataurus seed="john" size="48" variant="initial"></avataurus>
<avataurus seed="team" size="32" no-hover></avataurus>

JavaScript API — generate in code

import { generateAvatar } from 'avataurus'

const svg = generateAvatar('jane', { size: 128, variant: 'initial' })
document.getElementById('avatar').innerHTML = svg

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | size | number | 128 | Avatar size in pixels | | variant | 'face' \| 'initial' | 'face' | Eyes + mouth or eyes + letter | | colors | string[] | auto | Custom color palette |

Variants

  • face (default): Eyes + mouth expressions on colored backgrounds
  • initial: Eyes + first letter of the input string in monospace font

Web Component Attributes

| Attribute | Description | |-----------|-------------| | seed | String to generate avatar from (required) | | size | Pixel size (default: 48) | | variant | face or initial | | colors | Comma-separated color values | | no-hover | Disable hover animation |

How It Works

Avataurus runs your string through hash functions and extracts bits to deterministically select:

  • Background color from a curated 30-color palette
  • Eye shape from 8 types (dots, ovals, arcs, lines, diamonds, crosses, half-moons, rectangles)
  • Eye spacing and vertical position for natural variation
  • Mouth shape from 4 expressions (smile, line, circle, frown) or initial letter

The result is a unique avatar from millions of possible combinations. No API calls, no storage, no randomness — the string is the identity.

Features

  • Deterministic: Same input always produces the same output
  • Zero dependencies: No external libraries or fonts required
  • Scalable: Pure SVG that looks crisp at any size
  • Lightweight: 4KB gzipped, loads instantly
  • Edge-native: Runs on Cloudflare Workers worldwide
  • Accessible: Proper alt text and keyboard navigation support

Runs Everywhere

  • Browser: Any modern browser (ES2020+)
  • Node.js: 18+
  • Edge: Cloudflare Workers, Deno, Bun

Examples

// Basic face avatar
generateAvatar('alice')

// Initial variant
generateAvatar('bob', { variant: 'initial' })

// Custom size
generateAvatar('charlie', { size: 256 })

// Custom colors
generateAvatar('diana', { colors: ['#FF6B6B', '#4ECDC4'] })

TypeScript

Full TypeScript support included:

import { generateAvatar, type AvatarOptions } from 'avataurus'

const options: AvatarOptions = {
  size: 128,
  variant: 'initial',
  colors: ['#264653']
}

const svg: string = generateAvatar('user123', options)

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT © Mladen Ruzicic