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

artnet-bridge

v0.0.1

Published

ArtNet/DMX bridge to IoT lighting protocols

Downloads

110

Readme

artnet-bridge

Main application package. Orchestrates ArtNet reception, DMX mapping, rate-limited dispatch, protocol adapters, and the web UI.

Architecture

CLI (cli.ts)
  |
  +-- ConfigManager         Load/save/validate config with file locking
  |
  +-- BridgeOrchestrator    Central coordinator
  |     +-- ArtNetReceiver  Listens for ArtNet UDP packets
  |     +-- DmxMapper       Extracts per-entity channel values from raw DMX
  |     +-- Schedulers
  |     |     +-- RealtimeScheduler   Dirty-set batching for streaming entities
  |     |     +-- LimitedScheduler    Rate-limited round-robin for API entities
  |     +-- Protocol Adapters (loaded per bridge config)
  |
  +-- WebServer             Express-based HTTP + WebSocket
        +-- Config routes   REST API for config CRUD
        +-- Bridge routes   Discovery, pairing, bridge management
        +-- Status routes   System status
        +-- WebSocketHandler  Live status push with per-bridge subscriptions

Protocol Adapter Loading

Adapters are registered as factory functions keyed by protocol type. When the orchestrator starts, it creates an adapter instance for each configured bridge:

const adapterFactories = new Map<string, ProtocolAdapterFactory>();
adapterFactories.set("hue", (bridgeConfig) => {
  return new HueProtocolAdapter({ ... });
});

To add a new protocol, register its factory in cli.ts and add the package dependency. See Developing Protocol Adapters.

Config Management

  • Default location: ~/.artnet-bridge/config.json
  • Override with --config <path>
  • PID-based file locking prevents concurrent writes from server and CLI
  • Auto-creates default config on first run
  • Schema migration support with automatic backup

See Configuration for the full schema.

Dispatch Strategies

Realtime (streaming entities)

  • Dirty set tracks which entities have changed
  • On each rate tick (~6Hz), all dirty entities are batched and sent to the adapter via handleRealtimeUpdate
  • The adapter maintains its own continuous transmission (e.g., Hue DTLS at 50Hz)

Limited (API entities)

  • Insertion-ordered dirty set provides fair round-robin
  • One API call per rate tick, waiting for the previous call to complete before sending the next
  • Rate budget shared across all entities in the same category on the same bridge

Web UI

The web server provides:

  • Static file serving for the bundled frontend (vanilla JS/HTML/CSS, dark theme)
  • REST API for config and bridge management
  • WebSocket for live status with per-bridge subscriptions

See Web UI for usage details.

CLI

artnet-bridge                              # start server
artnet-bridge --config /path/config.json   # custom config
artnet-bridge --port 9090                  # custom web port
artnet-bridge --no-web                     # headless
artnet-bridge config discover              # find bridges
artnet-bridge config pair <host>           # pair with a bridge

See CLI Usage for full details.