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

ultimatedarktowerdisplay

v0.9.0

Published

Composable text, 2D, and 3D renderers for Return to Dark Tower tower state, with optional skull physics.

Readme


What this is, what it isn't

This package is the visual layer. It does not open a BLE connection, decode packets, or construct TowerState objects. Pair it with ultimatedarktower (UDT) for the BLE side, or feed it hand-built states for testing and demos.

The physical tower talks BLE to ultimatedarktower, which decodes packets into a TowerState. This package consumes that state and renders it as any combination of a text readout, a 2D SVG side view, and a 3D Three.js model.

flowchart LR
    Tower[Physical tower] -- BLE --> UDT[ultimatedarktower]
    UDT -- TowerState --> Display[TowerDisplay]
    Display --> Readout[readout<br/>DOM text]
    Display --> Side[side-view<br/>SVG]
    Display --> Three[3d-view<br/>Three.js]
    Readout --> DOM[(your DOM)]
    Side --> DOM
    Three --> DOM

For the full mental model see docs/ARCHITECTURE.md.

Install

npm install ultimatedarktowerdisplay ultimatedarktower

ultimatedarktower is a peer dependency. For the 3D renderer also install three and gsap (peer dependencies). For optional skull physics see docs/PHYSICS.md.

Quick start

The recommended entry point is TowerRenderView — a single class that wraps a TowerDisplay with sensible 3D defaults and optional header chrome (title, subtitle, status badges, action row).

import { TowerRenderView } from 'ultimatedarktowerdisplay';
import towerModelUrl from 'ultimatedarktowerdisplay/dist/3d/assets/tower.glb?url';
import { createDefaultTowerState } from 'ultimatedarktower';

const container = document.getElementById('tower');
if (!container) throw new Error('Missing #tower container');

const view = new TowerRenderView({ container, modelUrl: towerModelUrl });
view.applyState(createDefaultTowerState());

// Later, when a new state arrives:
// view.applyState(nextState);

// Tear down:
// view.dispose();
<div id="tower"></div>

TowerRenderView accepts every TowerDisplay option (renderers, lighting, camera, audio, callbacks). Advanced 3D config that isn't forwarded on the facade is reachable via view.display.* and view.view3D. The default renderer is '3d-view'; pass renderers: ['readout', 'side-view'] (or any subset) to opt out of the 3D pipeline.

Composable alternative

If you'd rather wire renderers yourself — or skip the .trv-root wrapper entirely — instantiate TowerDisplay directly:

import { TowerDisplay } from 'ultimatedarktowerdisplay';
const display = new TowerDisplay({ container });
display.applyState(createDefaultTowerState());

That renders the default composition: a text readout plus a 2D side view.

Renderers

| Capability | readout | side-view | 3d-view | | ------------------------ | -------------------- | ------------------ | -------------------------------------------------- | | Rendering tech | DOM text grid | Inline SVG | Three.js + WebGL2 | | Shows LED layers | All 6, all 4 sides | One side at a time | On the 3D model | | Shows drum positions | Numeric + glyph | Rotated SVG | Rotating meshes | | Shows audio info | Sample name + volume | No | Plays the sample (bundled default pack, swappable) | | Shows beam + skull count | Yes | No | No | | Side-aware | No | Yes | Yes | | Clickable seals | Optional | Yes | No (clicks land in 2D) | | Animations | None | LED tweens | Full (LEDs, drums, bloom) | | Bundle cost (rough) | <5 KB gzip | <10 KB gzip | ~150 KB gzip + 22 MB GLB + 20 MB audio |

Both TowerRenderView and TowerDisplay accept any subset of ['readout', 'side-view', '3d-view'] via the renderers option. TowerRenderView defaults to '3d-view'; TowerDisplay defaults to ['readout', 'side-view']. Full comparison and per-renderer details in docs/RENDERERS.md.

Where to go next

For the full documentation index see docs/README.md.

Development

npm install
npm run dev:example   # Vite dev server + open example/index.html
npm run typecheck
npm run lint
npm test
npm run build
npm run ci            # full pipeline (typecheck + lint + test + build)

See CONTRIBUTING.md for the development workflow and release process.

License

MIT. See LICENSE.