artnode

Artnet protocol implementation

Usage no npm install needed!

<script type="module">
  import artnode from 'https://cdn.skypack.dev/artnode';
</script>

README

ArtNode

A Node.JS work-in-progress implementation of Art-Net, a protocol which allows for DMX512 communications over ethernet.

Setting up

Install the package using npm or yarn:

npm install artnode
# or
yarn add artnode

Options

TODO

Examples

Listening for DMX

const ArtNet = require('../src/artnet');

const artnet = new Artnet({isController: true});

const universe = artnet.getUniverse(0);

universe.on('data', ({ data, changed }) => {
    changed.forEach(({ address, value }) => {
        console.log(`DMX ${address} set to ${value}.`);
    });
    
    data.forEach((value, address) => {
        console.log(`DMX ${address} is ${value}`);
    });
});

artnet.start();

Device discovery

const { ArtNet } = require('artnode');

const artnet = new ArtNet({isController: true});

artnet.on('device', (device) => {
    console.log(`New device: ${device.shortName} @ ${device.ip}`);
});

artnet.on('deviceOffline', (device) => {
    console.log(`Device ${device.shortName} @ ${device.ip} went offline.`);
});

artnet.start();