
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
dmx-tsDMX-512 controller library for node.js
This is a TypeScript rewrite of dmx.
npm install dmx-ts
// CommonJS style require
const { DMX } = require('dmx-ts');
// or ES import
import { DMX } from "dmx-ts";
DMXnew DMX()Create a new DMX instance. This class is used to tie multiple universes together.
name - Stringdriver - Instance of a Driver class, see belowAdd a new DMX Universe with a name and driver.
The following Drivers are available:
Development Drivers:
NullDriver(): a development driver that prints the universe to stdoutNetwork Drivers:
SocketIODriver(): a driver which sends out the universe via socket.IO as an array (see demo_socket_client.js as a client example)ArtnetDriver(): driver for ArtnetSACNDriver(): driver for sACNBBDMXDriver(): driver for BeagleBone-DMXSerial Drivers (USB):
DMX4AllDriver(): driver for DMX4ALL devices like the "NanoDMX USB Interface"EnttecUSBDMXProDriver(): a driver for devices using a Enttec USB DMX Pro chip like the "DMXKing ultraDMX Micro".EnttecOpenUSBDMXDriver(): driver for "Enttec Open DMX USB". This device is NOT recommended, there are known hardware limitations and this driver is not very stable. (If possible better obtain a device with the "pro" chip)DMXKingUltraDMXProDriver(): driver for the DMXKing Ultra DMX pro interface. This driver support multiple universe specify the options with Port = A or BEach driver has its own options. Example:
const universe1 = dmx.addUniverse('demo1', new NullDriver());
const universe2 = dmx.addUniverse('demo2', new ArtnetDriver("127.0.0.1"));
const universe2 = dmx.addUniverse('demo3', new EnttecUSBDMXProDriver("COM5", { dmxSpeed: 40 }));
dmx.update(universe, channels[, extraData])universe - String, name of the universechannels - Object, keys are channel numbers, values the values to set that channel toextraData - Object, this data will be passed unmodified to the update Event. (Optional; default value is {})Update one or multiple channels of a universe. Also emits a update Event with the same information.
DMX.devicesA JSON Object describing some Devices and how many channels they use.
Currently not many devices are in there but more can be added to the devices.js file. Pull requests welcome ;-)
The following Devices are known:
Animationnew Animation([options])Create a new DMX Animation instance. This can be chained similar to jQuery.
The options Object takes the following keys:
loop - Number, the number of times this animation sequence will loop when run is invoked. This value is overridden if you invoke runLoop.filter - Function, allows you to read or modify the values being set to each channel during each animation step.If you specify a filter function, it must take a single object parameter in which keys are channel numbers and values are the values to set those channels to.
You may modify the values in the object to override the values in real-time, for example to scale channel brightness based on a master fader.
animation.add(to, duration, options)to - Object, keys are channel numbers, values the values to set that channel toduration - Number, duration in msoptions - ObjectAdd an animation Step.
The options Object takes an easing key which allows to set a easing function from the following list:
linear (default)inQuadoutQuadinOutQuadinCubicoutCubicinOutCubicinQuartoutQuartinOutQuartinQuintoutQuintinOutQuintinSineoutSineinOutSineinExpooutExpoinOutExpoinCircoutCircinOutCircinElasticoutElasticinOutElasticinBackoutBackinOutBackinBounceoutBounceinOutBounceReturns an Animation object with the animation step added.
animation.delay(duration)duration - Number, duration in msDelay the next animation step for duration.
Returns an Animation object with the delay step added.
animation.run(universe, onFinish)universe - Object, reference to the universe driveronFinish - Function, called when the animation is doneRun the Animation on the specified universe.
animation.runLoop(universe)universe - Object, reference to the universe driverRuns an animation constantly until animation.stop() is called
The example below shows a value being animated for 5 seconds:
const animation = new Animation().add({
1: 255,
}, 100).add({
1: 0,
}, 100).runLoop(universe)
setTimeout(() => {
animation.stop()
}, 5000)
update Eventuniverse - String, name of the universechannels - Object, keys are channel numbers, values the values to set that channel toextraData - Object, data that was passed to the update method.This event is emitted whenever update is called either by the integrating application or by an animation step.
If triggered by an animation step, extraData.origin will be the string 'animation'.
npm version [patch / minor / major / [custom version number]]git tag v[yourVersion]git push --tagsv0.4.0
FAQs
A nodejs DMX library
We found that dmx-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.