0.0.1 • Published 5 years ago

artnode v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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();