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

@protoyard/avatars

v1.9.4

Published

Data-only avatar library for Protoyard: 175 portraits of fictional people as optimized square WebP (64 and 128 px) with a verified manifest.

Readme

@protoyard/avatars

A data-only library of 175 portraits of fictional people for Protoyard prototypes: square, center-cropped WebP at 64 and 128 px, plus a verified manifest. No Svelte, no runtime dependencies, no side effects.

Provenance

The repository owner generated these portraits as fake people for prototypes. They are not real people. They are published under this repository's license (MIT). Use them only as placeholder people in prototypes, and never present them as real customers, employees or users.

The original PNGs (about 228×223 px, cut from seven generated grids) are not in the repository. Only the optimized derivatives below are.

What ships

| Size | Files | Total | Average | Largest | WebP quality | | --- | --- | --- | --- | --- | --- | | 64 px | 175 | 153.1 KB | 0.88 KB | 1.07 KB | 70 | | 128 px | 175 | 348.0 KB | 1.99 KB | 2.75 KB | 65 | | All | 350 | 501.2 KB (513,196 bytes) | | | |

These are measured by tsx scripts/import-avatars.ts --check. The manifest (src/manifest.json) adds about 120 KB of JSON for tooling, and the package entry never imports it.

  • Ids: av-001 … av-175, numbered like the source files (avatar7.png → av-007).
  • Why two sizes: UI avatars render at 48 CSS px at most, so 64 px covers 1x screens and 128 px covers 2x screens.
  • Why WebP only: at equal PSNR on a 14-image sample, AVIF was about 22% smaller at 128 px (1.71 KB vs 2.19 KB at 33.9 dB) and about the same at 64 px. Adding AVIF next to a WebP fallback would grow the repository by about 300 KB to save about 80 KB per full download, so the library stays WebP-only. WebP is supported by every current browser.
  • Encoding: 6 px edge inset (this drops the slicing border and the rounded, transparent corners), centered square crop, flattened onto white, lanczos3 resize, lossy WebP (effort 6, smartSubsample), no alpha and no metadata. Quality was picked visually: at 64 px, q55–60 showed chroma blotches on skin, and q70 is clean.

Use

import { AVATAR_IDS, AVATAR_COUNT, AVATAR_SIZES, avatarFile, isAvatarId } from '@protoyard/avatars';

avatarFile('av-007', 128); // 'assets/128/av-007.webp' (package-relative)
isAvatarId('av-176'); // false

Seeded assignment

"Random" faces stay reproducible: the pickers draw only from the rng they are given (any Rng from @protoyard/core, such as ctx.rng or createRng(seed)), never from Math.random() or the clock. The same seed always gives the same faces.

import { assignAvatars, createAvatarPool, pickAvatar } from '@protoyard/avatars';

// Fork with a stable key so adding another generator never shifts these faces.
const avatars = createAvatarPool(ctx.rng.fork('my-app:avatars:customers'));
const customer = { name: 'Ada Example', avatar: avatars.next() };

assignAvatars(ctx.rng.fork('my-app:avatars:team'), 12); // 12 distinct ids
pickAvatar(ctx.rng); // one id; repeats are possible across calls

A pool deals every id once (175) in a shuffled order before it reshuffles, and never repeats a face back to back across rounds. Pass { avoid: ids } to deal ids already in use last in the first round, so people added by a later generator get fresh faces. The built-in generators already do this: generateTeam (@protoyard/scenarios, so blueprint worlds too), generateSaasWorld invitees (@protoyard/saas) and defaultPeople (@protoyard/views/scenarios).

The images resolve as @protoyard/avatars/assets/<size>/<id>.webp. Full metadata (bytes, sha256, width and height per size, the source file name and its sha256, and the encoder versions) is in @protoyard/avatars/manifest.json.

Re-import

The import is deterministic. The same source bytes and the same sharp/libvips/libwebp build give byte-identical files and manifest.

pnpm exec tsx scripts/import-avatars.ts --dry-run                 # report sizes, write nothing
pnpm exec tsx scripts/import-avatars.ts [--src <dir>]             # rewrite assets/ + src/manifest.json
pnpm exec tsx scripts/import-avatars.ts --check                   # verify committed files match the source
pnpm vitest run packages/avatars

--src <dir> (or PROTOYARD_AVATARS_SRC) is required: the owner's local folder of avatar<N>.png; _manifests/ and _previews/ are ignored. The script only writes inside packages/avatars. --check needs the original PNGs, and a different sharp or libwebp build can change the bytes. The manifest records the encoder versions it was made with.

Tests

tests/manifest.test.ts checks that there are 175 unique ids in source order that match the exports, that every file exists with its recorded bytes, sha256 and dimensions, that avatarFile refuses unknown ids and sizes, and that seeded picks give the same sequence for the same seed. PLAN_009 removed the stray-file check, the size budgets (64 px ≤ 4 KB, 128 px ≤ 12 KB per file, 128 px average ≤ 6 KB, all assets ≤ 1.2 MB) and the no-repeat pick cases, so those limits are no longer enforced by a test.

Package output

The manifest keeps TypeScript source exports for workspace development. pnpm build:packages --filter engine creates the ESM and declaration files under dist/ that the packed manifest exposes.