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

@shiinasaku/github-card

v5.1.0

Published

Beautiful GitHub stats SVG cards. Embed in README, use as API, or render programmatically.

Readme

Beautiful, blazing-fast GitHub profile cards

Live SVG cards for your README — stars, commits, languages, all auto-updating. One line, zero config, edge-cached.

npm version npm downloads License TypeScript types Bun Deploy with Vercel

Live instance · shiinasaku · theme shiina — updates itself as you code


✨ What's new in 4.2

System-font only · no shipped .woff2 · crisper text (geometricPrecision, tabular numbers) · new 24 px icons (MingCute / Huge / Tabler) · airy stat stack with 7 px gaps, no boxes · default affiliations=owner — org stars excluded unless ?affiliations=affiliated · fully typed github.ts & github-client, cache v9.


Quickstart

Paste into your profile README — replace shiinasaku with your username:

[![GitHub Card](https://card.shiina.xyz/card/shiinasaku?theme=shiina)](https://github.com/shiinasaku)

That's it. No sign-up, no build — the card refreshes automatically as cached data expires.

Requires Bun 1.4.4 or newer. Add a GitHub token to .env for local API requests; the renderer library itself does not need a token. tsdown builds require Node.js 22.18+ (build time only); the package output targets Node.js 20.19+.

bun install
cp .env.example .env   # add GITHUB_TOKEN
bun run dev:server     # http://localhost:3000

| Command | Action | | ------------------- | ----------------------- | | bun run dev | tsdown watch build | | bun run build | tsdown production build | | bun test | Run tests | | bun run typecheck | Native bun check | | bun run fmt | Bun native formatter | | bun run fmt:check | Check formatting |

Formatting uses Bun's built-in bun fmt; no separate formatter or linter is installed. Bun 1.4.4 does not provide a built-in bun lint command. bun check enforces strict typing and unused-symbol checks. TypeScript is retained only to emit the library’s .d.ts files during builds. The library bundle and .d.ts declarations are produced by tsdown from src/lib.ts into dist/. bun run dev:server runs the API locally; bun run dev watches the library build.

src/index.ts serves as the entrypoint for Vercel and local development, starting a listener only when run directly. The rendering library is unchanged.


Why GitHub Card?

One line, zero config An <img> tag is the entire integration. No OAuth, no action.

Edge-fast L1 memory + L2 Redis SWR, s-maxage=1800, stale-while-revalidate, ETag/304. Warm hits render in microseconds.

Retina avatars Profile images inlined as Base64 at 2×, clipped + ringed in pure SVG.

Adaptive layout Width, wrapping, and legends measured with per-glyph metrics — nothing ever overlaps or clips.

Users and orgs GET /card/:login works for users and organizations.

Glassmorphic depth Radial + linear ambient gradients track your accent for volumetric light at zero runtime cost.

OpenAPI docs live at /openapi. Pure ESM lib, zero server dep for renderCard.


Themes — 21 hand-tuned

Preview every theme with your own data:

![All themes](https://card.shiina.xyz/shiinasaku/themes)

| Dark favorites | Light & accent | | -------------------------------------------------- | ------------------------------------------------ | | shiina · aurora · oled · slate | default · pearl · sand | | github_dark · dark · nord · dracula | forest · rose · cobalt | | tokyonight · synthwave · radical · monokai | gruvbox · merko · onedark · highcontrast |

Add ?theme=tokyonight or override any slot with hex or Tailwind tokens: pink-400, #ff79c6, ff79c6.


Customization

| Parameter | Type | Description | | -------------- | :--------: | ----------------------------------------------------------------- | | theme | string | Built-in theme (table above) | | bg_color | string | Background fill | | title_color | string | Name / title | | text_color | string | Stats, labels, body | | icon_color | string | Icons + ambient glow | | border_color | string | Card outline | | hide_border | boolean | Remove outline | | compact | boolean | Slim — hides bio/pronouns/Twitter/legend | | animate | boolean | Fade-in stats + animated language bar | | hide | string[] | Hide stats: stars, commits, issues, repos, prs | | hide_langs | string[] | Exclude hide_langs=html,css | | show_langs | string[] | Only show_langs=typescript,rust | | lang_count | 1–10 | Top languages (default 5) | | scope | string | personal (default), org, all | | orgs | string[] | Restrict org stats to orgs=vercel,elysiajs | | affiliations | string | owner (default) or affiliated — org stars excluded by default | | fields | string[] | Fetch only fields=stats for speed |

What the numbers mean

  • Stars, repositories, and languages come from non-fork repositories in the requested scope. affiliations=owner is the default for both the HTTP API and getProfileData.
  • User commits are contributions credited by GitHub from January 1 (UTC) to now, not lifetime commit counts. Default user PR/issue totals are lifetime authored totals. With scope=org, commits, PRs, and issues are this year's contributions to the selected organizations.
  • scope=all combines personal and contributed organization repositories without counting a repo twice; its activity totals remain the user's totals. orgs filters the organization portion.
  • Organization accounts have repository/star/language data, but no computed activity totals. Those metrics display — (and are null in UserStats), not a misleading zero.
  • Language filters run before lang_count. Percentages describe the displayed languages by code size, not time spent coding. The bar and legend use the same “Other” group.
  • Results depend on what the GitHub token can access. GitHub's query limits still apply: the top 10 languages per repository and up to 100 repositories in each org contribution breakdown. Repository pagination supports up to 10,000 repos per connection; reaching that limit with more pages remaining returns an error rather than caching incomplete totals.

Examples

<!-- Dracula, no border, animated -->

![card](https://card.shiina.xyz/card/shiinasaku?theme=dracula&hide_border=true&animate=true)

<!-- Fully custom colors -->

![card](https://card.shiina.xyz/card/shiinasaku?bg_color=0d1117&title_color=58a6ff&text_color=9da7b3&icon_color=58a6ff)

<!-- Compact, no issues/prs -->

![card](https://card.shiina.xyz/card/shiinasaku?compact=true&hide=issues,prs&fields=stats)

<!-- Include org stars explicitly -->

![card](https://card.shiina.xyz/card/shiinasaku?affiliations=affiliated)

<!-- Organization -->

![card](https://card.shiina.xyz/card/elysiajs)

Deploy your own

Deploy with Vercel

  1. Click the button (or fork + import).
  2. Add env vars:

| Variable | Required | Purpose | | :------------: | :------: | ----------------------------------- | | GITHUB_TOKEN | ✅ | GitHub PAT — read-only is enough | | REDIS_URL | ➖ | Redis / Upstash for shared L2 cache |

  1. Done — serves /card/:username on Vercel CDN s-maxage=1800, stale-while-revalidate=1800.

Without Redis, bounded in-memory cache (1000 entries, SWR 30 min) still keeps warm instances fast.


API

| Endpoint | Description | | ----------------------- | ------------------------------------------- | | GET /card/:username | SVG card — all params above | | GET /:username/themes | One SVG with all themes for a user | | GET /meta | Service metadata + theme list | | GET /health | Uptime, cache telemetry, Redis reachability | | GET /openapi | Interactive OpenAPI docs |

Responses: image/svg+xml, ETag + CDN-Cache-Control + CORS *. Conditional If-None-Match → 304.


Use as a library

bun add @shiinasaku/github-card     # Bun
npm install @shiinasaku/github-card # Node / Next / Vite
import { renderCard, themes } from "@shiinasaku/github-card";

const svg = renderCard(user, stats, languages, { theme: "tokyonight" });
// → SVG string, no network or server required

Prebuilt dist/lib.js + .d.ts; Bun resolves raw TS via bun export condition. Pure renderer — no network, no server.


Architecture

flowchart LR
  A[GET /card/:username] --> B[Elysia<br/>validation · CORS · OpenAPI · timing]
  B --> C{L1 memory<br/>SWR 30m}
  C -- hit --> G[render SVG<br/>ETag/304 → CDN]
  C -- miss --> D{L2 Redis<br/>SWR 30m}
  D -- hit --> G
  D -- miss --> E[GitHub GraphQL<br/>100/page, up to 100 pages, 6s/request]
  E --> F[typed fetch<br/>+ avatar 150px]
  F --> G
  G --> H[Pure SVG<br/>system fonts · measured layout · glass]
  • Bun + Elysia — one of the fastest HTTP stacks.
  • Two-tier SWR — stale served instantly + background refresh, request coalescing via inFlight.
  • Typed upstream — RepoNode/ContributionEntry generics, T=unknown, TimeoutError/RateLimitError mapping.

Releasing

Automated through staging; the npm publish needs one maintainer approval:

  1. Actions → Bump → patch / minor / major / prerelease.
  2. Workflow bumps package.json, commits, tags vX.Y.Z, then dispatches Release.
  3. Release verifies the tag/version, runs formatting, typecheck, tests, build, and npm pack --dry-run, then stages the package on npm with provenance and creates the GitHub Release.
  4. Approve the staged package on npmjs.com (or npm stage approve <id>) to make it installable.

MIT © saku shiina — built with Bun, Elysia, and system fonts.

Stars default to owner only in 4.2 — add ?affiliations=affiliated to include orgs.