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-proto

v1.0.4

Published

A TypeScript library implementing the Art-Net protocol

Readme

artnet-proto

A modern TypeScript implementation of the Art‑Net v4 protocol for DMX‑over‑IP communication.

This library lets you send DMX512 channel data over a network to compatible lighting controllers and fixtures using Art‑Net.

npm License


Features

  • Fully written in TypeScript
  • Supports multiple universes
  • Optional throttling and periodic refresh
  • Broadcast or unicast output
  • trigger() support for ArtTrigger packets
  • Discovery of Art-Net nodes via ArtPoll/ArtPollReply (parses shortName, longName, nodeIp, portCount, universesIn, universesOut)
  • Matches Art‑Net 4 specification for byte‑perfect packet structure

[!note] Discovery returns nodes (controllers/gateways), not individual DMX fixtures behind them. RDM is not implemented.


Installation

npm install artnet-proto

TypeScript‑based, you get type definitions out‑of‑the‑box.


Basic Usage

import { Artnet } from "artnet-proto";

// Create an Art-Net instance
const artnet = new Artnet({
  host: "255.255.255.255", // broadcast by default
  port: 6454,
  refresh: 4000,
  sendAll: false
});

// Set single DMX channel
artnet.set(0, 1, 255); // Universe 0, Channel 1, Value 255

// Set multiple channels at once (RGB full red)
artnet.set(0, 1, [255, 0, 0]); // channels 1=R, 2=G, 3=B

// Close when done
setTimeout(() => artnet.close(), 5000);

Discovery (ArtPoll / ArtPollReply)

import { Artnet } from "artnet-proto";

const artnet = new Artnet(...);
const nodes = await artnet.discoverNodes(1500);

for (const n of nodes) {
  console.log(
    `${n.info.shortName} @ ${n.ip} | ports=${n.info.portCount} ` +
      `outs=[${n.info.universesOut.join(", ")}]`,
  );
}

// Optional: switch to unicast → first node
if (nodes[0]) artnet.setHost(nodes[0].ip);

API Reference

new Artnet(config?: ArtnetConfig)

Creates a new Art‑Net sender instance.

ArtnetConfig options: | Key | Type | Default | Description | |------------|-----------|----------------------|-------------| | host | string | 255.255.255.255 | Target IP or broadcast | | port | number | 6454 | UDP port to send on | | refresh | number | 4000 | Auto‑refresh interval in ms | | sendAll | boolean | false | Always send all 512 channels | | interface| string | undefined | Network interface to bind |


.set(...)

Set DMX channel(s) in a universe and send. Supports multiple overloads:

set(universe: number, channel: number, value: number, callback?: ArtnetCallback)
set(universe: number, channel: number, values: number[], callback?: ArtnetCallback)
set(channel: number, value: number, callback?: ArtnetCallback)
set(channel: number, values: number[], callback?: ArtnetCallback)
set(value: number, callback?: ArtnetCallback)
set(values: number[], callback?: ArtnetCallback)

.send(universe, refresh?, callback?)

Manually send ArtDMX packet for a universe.


.trigger(...)

Send an ArtTrigger packet (per spec p.40).


.discoverNodes(timeoutMs = 2000): Promise<Array<{ ip, port, info }>>

Broadcasts ArtPoll, collects ArtPollReply, parses:

interface ArtNetNodeInfo {
  shortName: string;
  longName: string;
  nodeIp: string;
  portCount: number;
  universe: number; // first input universe for convenience
  universesIn: number[]; // from Net/Sub + SwIn[0..3] low nibble
  universesOut: number[]; // from Net/Sub + SwOut[0..3] low nibble
}

.setHost(host: string): void

Change the destination IP (e.g., switch to unicast).


.setPort(port: number): void

Change UDP port (not allowed when host is global broadcast).


.close()

Stop all timers and close the UDP socket.


Example: Sending Full Universes at 25fps

Check working demo in examples/artnet-demo.ts:


Build

Compile TypeScript to lib/:

npm run build

Clean build artifacts:

npm run clean

License

See LICENSE for details.


Notes / Limits

  • Discovery returns nodes, not fixtures (no RDM).

  • Ensure your node’s DMX output ports are mapped to the universes you’re sending.

  • Some fixtures need a master dimmer channel ≥ 1 in addition to RGB.

  • UDP has no delivery guarantee; if no error is reported, the frame was handed to the OS.


References