Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/woutervdbrink/node-artnode
Node.JS implementation of Art-Net [WIP]
https://github.com/woutervdbrink/node-artnode
Last synced: 18 days ago
JSON representation
Node.JS implementation of Art-Net [WIP]
- Host: GitHub
- URL: https://github.com/woutervdbrink/node-artnode
- Owner: WoutervdBrink
- License: mit
- Created: 2019-09-30T21:58:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-19T15:36:10.000Z (over 4 years ago)
- Last Synced: 2024-12-29T21:34:26.167Z (25 days ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ArtNode
A Node.JS work-in-progress implementation of [Art-Net](https://art-net.org.uk/), a protocol which allows for DMX512
communications over ethernet.# Setting up
Install the package using `npm` or `yarn`:```shell script
npm install artnode
# or
yarn add artnode
```# Options
TODO# Examples
## Listening for DMX
```javascript
const ArtNet = require('../src/artnet');const artnet = new Artnet({isController: true});
/*
use getUniverse(0, false) to receive every data packet
regardless of whether they contain changes to previous
data or not
*/
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
```javascript
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();
```