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

@glowbox/extras

v1.1.0

Published

Content helpers for @glowbox/led-grid — GIF/image animation player + text, painted onto the LED grid.

Readme

@glowbox/extras

Content helpers for @glowbox/led-grid — the opt-in content layer the core deliberately ships without. Headlined by a GIF / image animation player, a text helper with a bundled 5×7 bitmap LED font, and a text scroller (marquee). Each helper works with any wrapper: the players and the scroller return a (d, dt) => void draw callback; text() draws once. They operate on the plain VoxelGrid / LedDisplay, so they also run headlessly.

yarn add @glowbox/extras   # @glowbox/led-grid comes along
import { makeGifPlayer, makeImagePlayer, text } from '@glowbox/extras';

// Play a GIF on the front face of the grid:
display.onFrame(makeGifPlayer('/loop.gif', { plane: 'xy', fit: 'contain' }));

// …or a still image:
display.onFrame(makeImagePlayer('/logo.png', { fit: 'cover' }));

// …or draw text in your own frame callback:
display.onFrame((d) => {
	d.clear();
	text(d, 'HI', { color: '#00e5ff' });
});

With a framework wrapper, hand the callback to the draw prop:

<LedGrid size={[32, 32, 8]} draw={makeGifPlayer('/loop.gif')} />

Players

makeImagePlayer(url, opts) / makeGifPlayer(url, opts) → a draw callback. They load asynchronously and draw nothing until ready; GIFs advance by their frame delays and loop. GIF frames are decoded with gifuct-js and composited (honouring frame disposal) into full RGBA snapshots.

Options (PlayerOptions)

| option | default | notes | | ----------- | ----------- | -------------------------------------------------------------------- | | plane | 'xy' | grid plane to paint on — 'xy' (faces camera), 'xz', 'yz' | | depth | middle | index on the plane's normal axis | | fit | 'contain' | aspect fit: 'contain' (letterbox) · 'cover' (crop) · 'stretch' | | threshold | 0.5 | skip cells with coverage below this | | gain | 1 | multiply painted colour (>1 blooms in the hologram style) | | clear | true | clear the grid before painting each frame |

Text

text(d, str, opts) draws a string onto a grid plane. Two font paths:

  • font: 'bitmap' (default) — the bundled 5×7 dot-matrix LED font (printable ASCII; unknown chars render a hollow box). Deterministic on every OS, DOM-free (runs headlessly in node), multi-line via \n (lines centred, 1-row gap), integer scale (default 1 → a 6×8-cell advance per character).
  • font: 'system' — rasterize with the platform's bold sans-serif (browser-only, single line). fontSize (grid cells; default ~80% of the plane height) and threshold apply to this path.

Common options: plane, depth, color (a Color). measureText(str, scale?) returns the bitmap ink box { width, height } in cells.

Scroller

makeTextScroller(text, opts) → a draw callback that scrolls a message across a plane, wrapping seamlessly (message + gap blank columns tile end to end). text may be a string or a getter (() => string) so a live UI can retype without recreating.

| option | default | notes | | --------------------------- | -------------- | ---------------------------------------------------------------- | | font | 'bitmap' | 'bitmap' (bundled 5×7) · 'system' (rasterized, browser-only) | | color | white | a Color, or (column, elapsed, width) => Color for gradients | | speed | 10 | cells per second | | gap | glyph height | blank columns between repeats | | scale | 1 | bitmap pixel scale | | fontFamily | sans-serif | system font family — string or getter | | fontSize | ~85% of height | system font size in cells | | plane / depth / clear | — | as in PlayerOptions |

Building blocks

sampleImageToGrid(src, nx, ny, fit) (pure, no DOM) does the image → grid mapping. decodeGif(url) / framesFromBuffer(arrayBuffer) decode a GIF to GifFrames and frameAt(frames, tMs) picks the frame for a playback time; decodeImage(url) decodes a still image. paintImage(grid, src, opts) plots a decoded image onto a plane. FONT_5X7 / glyph5x7(ch) expose the bitmap font's metrics and per-character row bitmasks. Reuse any of them for custom effects.

Wrappers: @glowbox/svelte · @glowbox/react · @glowbox/vue. Live demos: https://eetu.github.io/glowbox/.