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

@simon_he/repo-3d-badge

v0.1.5

Published

Turn any GitHub repository into a textured 3D terminal badge — contributors orbit a 3D extrusion of the repo logo, rendered with WebGPU in your terminal.

Readme

@simon_he/repo-3d-badge

Turn any GitHub repository into a textured 3D terminal badge. Contributors orbit a 3D extrusion of the repo logo, rendered with WebGPU in your terminal.

3D badge concept

Quick Start

# Install (requires Bun + bun-webgpu for the 3D renderer)
bun add @simon_he/repo-3d-badge bun-webgpu

# Run
npx repo-3d-badge vuejs/core
npx repo-3d-badge https://github.com/facebook/react

Or from this monorepo:

bun run run:repo-3d-badge -- vuejs/core

How It Works

  1. Fetch repo data — Calls the GitHub REST API to get repo metadata, top contributors, and resolves a logo (from README → OpenGraph → owner avatar → generated monogram fallback).

  2. Build logo SDF texture — Decodes the logo PNG, extracts the alpha mask, and computes a signed distance field (SDF) via the Felzenszwalb-Huttenlocher Euclidean distance transform. Packs RGB (logo color) + A (normalized SDF) into a 128×128 texture.

  3. Build avatar atlas — Downloads each contributor's GitHub avatar, resizes to 32×32, and tiles into an atlas texture.

  4. Render with WebGPU — A raw WGSL compute shader raymarches the logo SDF into a 3D extrusion with beveled edges, brushed-metal/gloss/rim material, soft shadows, and ambient occlusion — all sampled from the logo's own colors. Contributor avatars are mapped onto orbiting spheres with glass-like highlights.

The key technique: texture-sampled SDF

The original vue-tui badge uses a hardcoded Vue triangle SDF in the shader. This package replaces that with a texture-sampled SDF: any logo's alpha mask is transformed into a distance field texture, and the shader samples it to determine the 3D shape. The entire material framework (extrusion, bevel, brushed metal, gloss, rim light, AO, soft shadows) is reused unchanged — so any logo gets the same premium 3D treatment while keeping its own brand colors.

CLI Usage

Usage: repo-3d-badge <github-repo>

Examples:
  repo-3d-badge vuejs/core
  repo-3d-badge https://github.com/facebook/react

Options:
  GITHUB_TOKEN / GH_TOKEN   Optional token to raise API rate limits.
  VT_MAX_CONTRIBUTORS       Max contributors to fetch (default 100).

Controls (interactive terminal)

  • Drag — rotate the scene
  • Hover — preview a contributor
  • Click — lock selection
  • Scroll — zoom
  • Q — quit

Programmatic API

import { fetchRepo3DData, createRepoBadgeRenderer } from "@simon_he/repo-3d-badge";

// 1. Fetch repo data
const data = await fetchRepo3DData("vuejs/core", {
  token: process.env.GITHUB_TOKEN, // optional, raises rate limit
  maxContributors: 50,
});

// 2. Build the WebGPU renderer
const { renderer, contributorCount, logoSource } = await createRepoBadgeRenderer(data);

// 3. Use with T3DViewport (see src/app.ts for full example)
// renderer.render(context)  -> TVideoFrame
// renderer.hitTest(context) -> T3DHitResult | null

Architecture

src/
├── types.ts          # Shared data types
├── github.ts         # GitHub API: repo meta, contributors, logo resolution
├── image.ts          # PNG decode/resize, avatar atlas, logo fallback
├── sdf.ts            # Felzenszwalb-Huttenlocher EDT + SDF texture builder
├── scene.ts          # Dynamic contributor sphere layout + ray picking
├── badge.wgsl.ts     # WGSL shader (texture-sampled SDF + reused material framework)
├── renderer.ts       # Packs textures, builds shader, creates T3DRenderer
├── app.ts            # Vue component (TBox + T3DViewport + status bar)
├── cli.ts            # CLI entry point
└── index.ts          # Public API exports

Requirements

  • Bun runtime + bun-webgpu (macOS arm64/x64, Linux x64, Windows x64)
  • Node.js >= 18 (for programmatic API without 3D rendering)
  • A GitHub token is optional but recommended (60 → 5000 requests/hour)

License

MIT