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

branch-beacon

v1.0.0

Published

A friendly little git branch indicator for the corner of your dev client. Color-coded so working branches feel safe and protected ones stand out. React component, hidden in production by default.

Readme

branch-beacon

A friendly little git branch indicator that lives in the corner of your dev client. It's color-coded, so working branches feel safe and protected ones stand out. Adapts to your project's design tokens automatically; hidden in production by default.

branch-beacon in a header

import { BranchBeacon } from "branch-beacon";

<BranchBeacon />

That's it. The component fetches the current branch from /api/dev/git-branch, classifies it (main / dev / feat/* / fix/* / other), picks a color from the host project's CSS variables (or sensible fallbacks), and renders an inline SVG marker plus the branch name. In production builds, it renders nothing.

Why

Working in a multi-branch repo means losing track of which branch your local dev server is showing. A branch indicator in the corner of your UI fixes that — but every project re-builds the same widget from scratch. branch-beacon is the widget, plus the small backend handler, packaged once.

Risk-inverted color philosophy: protected branches (main, master, release/*) render in alarming colors so accidentally pointing at production looks alarming. Working branches (feat/*, fix/*) look safe.

Install

npm install branch-beacon

For the vanilla Web Component variant (Vue / Svelte / Astro / plain HTML): branch-beacon-element.

Quick start

import { BranchBeacon } from "branch-beacon";

export function Header() {
  return (
    <header>
      <BranchBeacon />
    </header>
  );
}

Defaults: SVG marker, default classifier, default colors, no polling, /api/dev/git-branch endpoint, hidden in production.

Customization

<BranchBeacon
  shape="dot"
  glow
  markerSize={10}
  colors={{ main: "var(--my-danger)" }}
  pollMs={30_000}
  className="text-xs uppercase"
/>

glow works on every shape — drop-shadow follows the visible pixels, even on SVG. Tune the radius via --branch-glow. Pass any node to icon to override the default glyph entirely:

<BranchBeacon icon={<MyLogo width={12} height={12} />} />

| shape | Render | |---|---| | "svg" (default) | | | "icon" | | | "dot" | | | "led" | | | "pill" | |

Risk-inverted color palette

| Pattern | Kind | Sample | |---|---|---| | main, master, release/* | main | | | dev, develop | dev | | | feat/* | feat | | | fix/*, hotfix/* | fix | | | anything else | other | |

Full prop reference, theming guide, headless hook (useBranchInfo), and live Storybook demo: github.com/MiguelDotL/branch-beacon

Backend

The component expects GET /api/dev/git-branch to return:

{ "branch": "feat/example" }

…or { "branch": null } on any failure. Reference handlers for Express, FastAPI, Flask, and Go are in the examples/ directory.

Minimal Express version:

import { spawn } from "node:child_process";

app.get("/api/dev/git-branch", (_req, res) => {
  const child = spawn("git", ["rev-parse", "--abbrev-ref", "HEAD"], { timeout: 2_000 });
  let out = "";
  child.stdout.on("data", (b) => { out += b.toString(); });
  child.on("close", (code) => res.json({ branch: code === 0 ? out.trim() || null : null }));
  child.on("error", () => res.json({ branch: null }));
});

Production

Hidden by default — auto-detected via process.env.NODE_ENV === "production" (statically replaced at build time by every mainstream bundler).

<BranchBeacon enabled />          // force-show in production (staging dashboards, internal-only deploys)
<BranchBeacon enabled={false} />  // force-hide

License

MIT