Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-sacn-in

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-sacn-in - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

6

package.json
{
"name": "node-red-contrib-sacn-in",
"version": "0.0.1",
"version": "0.1.0",
"description": "Streaming ACN Input node for Node-RED",
"main": "index.js",
"main": "none",
"scripts": {

@@ -13,3 +13,3 @@ "test": "echo \"Error: no test specified\" && exit 1"

"nodes": {
"sacn-in": "sacn-in.js"
"sacn_in": "sacn-in.js"
}

@@ -16,0 +16,0 @@ },

@@ -0,22 +1,29 @@

console.log('UNIT');
module.exports = function(RED){
var e131 = require('e131');
function SacnInNode(config){
var server = new e131.Server(parseInt(config.universe))
RED.nodes.createNode(this, config);
if(config.universe < 1){
config.universe = 1;
}
var server = new e131.Server(parseInt(config.universe))
var node = this;
server.on('packet', (packet)=>{
const chans = packet.getSlotsData();
chans.forEach((chan, index) => {
let msg = {
topic: index + 1,
payload: chan
node.on('close', ()=>{
server._socket.close();
})
let timer = null;
server.on('packet', (packet)=>{
const chans = packet.getSlotsData();
if(timer == null){
timer = setTimeout(()=>{
node.send({payload: chans});
timer = null;
}, (parseInt(config.interval) || 100))
}
node.send(msg);
})
})
}
RED.nodes.registerType("sacn-in", SacnInNode);
RED.nodes.registerType("sacn_in", SacnInNode);
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc