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 🙏

© 2024 – Pkg Stats / Ryan Hefner

dmx-web-api

v0.2.10

Published

Talk DMX via USB directly in the browser (Chrome only for now)

Downloads

34

Readme

DMX Control directly from your browser

This super tiny lib knows how to talk DMX through browser's Web Serial API. Works with Enttec's Open DMX as well as the Pro version, and Eurolite's USB-DMX512 PRO Interface MK2.

Patches for other devices are most welcome!

Note: the API is supported by Chrome only!

Unfortunately other browsers do not yet support neither the Serial nor USB API's, generally claiming security reasons.

Linux

On linux, the user running the browser needs to be in the dialout group, so make sure you run this line:

sudo usermod -a -G dialout $USER

And then reboot your device.

Install

npm install dmx-web-api

Demo

import {DMX, BufferedBackend} from "dmx-web-api";

let dmxDevice = new DMX();

function initDMX() {
    `The three params passed into init are as follows:
      * onTick - callback that will be executed on every tick
      * backendClass - the class of the backend widget - there seem to be two types - direct communication and buffered.
        Buffered is the pro version and is recommended as it also comes with power isolation and other bits and bobs.
      * requestAccess - default:false, when set to true will ask user to give us access. you can do that only on
        user action. so on init you can call it with false, and then have an interface element that allows user to
        enable access to the device`;
    this.dmxDevice.connect(null, BufferedBackend, true);
}

function updateDMX(data) {
    // data can be either an object of form {channel: value}, or a full 512 element array.
    // set first channel to 255 (say, because you have a simple RGB light listening on address 1)
    this.dmxDevice.update({1: 255, 2: 0, 3: 0});
}

Note on Enttec's Open DMX

Make sure the tab you are sending the signal from is visible at all times, as chrome will spin down the internal timers when the tab is not visible, and you will get flickering lights. A simple way around that is to run a tiny node server and talk sockets to it. Code for doing that is in the github repo.