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

stagehack-sacn

v1.0.7

Published

Library for sending and receiving sACN (E1.31) lighting data

Downloads

10

Readme

🔌stagehack-sACN

Simple library for sending and receiving sACN (E1.31) lighting data. It is not the full E1.31 protocol, but should be close enough for most projects.

This library supports

  • Multiple network interfaces
  • Multicast and Unicast
  • ETC Net3 (coming soon)

Installation

npm install stagehack-sacn

Sender

const ACNSender = require('stagehack-sACN').Sender;
ACNSender.Start([options]);
var universe = new ACNSender.Universe([universe], [priority]);

Sender Options:

  • interfaces: Array of IPv4 network interfaces on the device to send from. ex: ['192.168.0.40, 10.0.0.5']
  • cid: 16-character UUID to represent this device. ex: "036b2d4932174812"
  • source: Plaintext name of this device. ex: "Tim's MacBook Pro"

Universe Options:

  • universe: Default: 1
  • priority: Default: 100

Example:

const ACNSender = require('stagehack-sACN').Sender;
ACNSender.Start({
	interfaces: ["192.168.0.40"]
});

var sender = new ACNSender.Universe(1, 100);
sender.on("ready", function(){
	 // send as an array
	this.send([255, 0, 0, 255]);

	// or send as key-value pairs
	this.send({
	 	4: 255,
	 	11: 150,
	 	301: 155
	});
});

Sender also provides sender.getPossibleInterfaces() which returns a list of all IPv4 network interfaces on the device. Useful for populating a dropdown or other UI.

Receiver

const ACNReceiver = require('stagehack-sACN').Receiver;
ACNReceiver.Start();
var universe = new ACNReceiver.Universe([universe]);

Universe Options:

  • universe: Default: 1

Example:

receiver.on("packet", function(packet){
 console.log(packet.getSlots());
});

Packet

Setters:

  • setUniverse: sets the Universe
  • setPriority: sets the Priority
  • setCID: sets the CID
  • setSource: sets the Source
  • setSlots: sets the Slots

Getters:

  • getUniverse: gets the Universe
  • getPriority: gets the Priority
  • getCID: gets the CID
  • getSource: gets the Source
  • getSlots: gets current Slots (length 1-512)
  • getSequence: gets current Sequence
  • getBuffer: returns a Buffer of the complete sACN Packet

TODO

  • Add "allReady" event for when all Senders/Receivers are ready
  • Implement Net3