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

avataar-me

v0.1.0

Published

Deterministic, ultra-fast fallback avatar generator for React apps — cartoon or initials mode, persisted via Supabase.

Readme

avataar-me

Deterministic, ultra-fast fallback avatars for React apps.

  • 🧑‍🎨 Modes: cartoon (cute character) or initials (clean monogram)
  • ⚡️ Instant render: inline SVG (no image fetch on first paint)
  • 🗃️ Optional background persist to Supabase Storage + registry table
  • 🔎 Built-in lookup: on repeat visits you get a cached CDN URL immediately
  • 🧩 Works great with shadcn/ui <Avatar> and any avatar components

This README uses the hosted proxy: https://avatars-proxy.vercel.app
If you self-host, see Centralized backend below.


Table of Contents


Installation

npm i avataar-me
# or
yarn add avataar-me
# or
pnpm add avataar-me

No configuration needed with the hosted proxy.

Quick Start (shadcn/ui example)

"use client";

import { useEffect, useState } from "react";
import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
import { AvataarMe, getAvatarUrl } from "avataar-me";

export default function UserAvatar() {
  const user = { name: "Pritesh Chandra", email: "[email protected]" };
  const [src, setSrc] = useState<string>();

  // Optional: pre-fetch stored CDN URL (repeat visits)
  useEffect(() => {
    (async () => {
      const url = await getAvatarUrl({ name: user.name, email: user.email });
      setSrc(url); // may be undefined on first load; fallback still renders instantly
    })();
  }, [user.name, user.email]);

  return (
    <Avatar className="h-16 w-16">
      {src && <AvatarImage src={src} alt={user.name ?? "avatar"} />}
      <AvatarFallback>
        <AvataarMe
          name={user.name}
          email={user.email}
          mode="cartoon"    // or "initials"
          size={64}
        />
      </AvatarFallback>
    </Avatar>
  );
}

What happens

  • First visit: inline SVG renders instantly (no network). A background request persists it.
  • Refresh: lookup finds the stored URL and loads from CDN.

API

props

type AvataarMode = "cartoon" | "initials";

type AvataarMeProps = {
  name?: string | null;                  // used for initials + metadata
  email?: string | null;                 // preferred for deterministic key/lookup
  size?: number;                         // px (width=height), default: 48
  mode?: AvataarMode;                    // default: "cartoon"
  ensure?: boolean;                      // persist in background, default: true
  bg?: "solid" | "none";                 // cartoon background, default: "solid"
  variant?: "beam" | "ring" | "grid";    // initials variants
};

Examples

// Cartoon (default)
<AvataarMe name={user.name} email={user.email} size={48} />

// Initials with a variant
<AvataarMe name={user.name} email={user.email} mode="initials" variant="ring" size={40} />

// Inline only (no persistence)
<AvataarMe name={user.name} email={user.email} ensure={false} />

getAvatarUrl(user)

Returns the stored CDN URL if found via the registry; otherwise a deterministic public URL (which will exist after the first persist).

const url = await getAvatarUrl({ name: user.name, email: user.email });

Optional runtime config

If you self-host the proxy and want to override the host at runtime:

import { configureAvataarHost } from "avataar-me";

configureAvataarHost("https://avatars.mycompany.com");
// subsequent calls use this host for /lookup, /ensure, and public URLs