1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/utility/junction/junction.js

20 lines
539 B
JavaScript
Raw Normal View History

2022-03-01 12:40:56 +01:00
module.exports = function(RED) {
var version = RED.version();
var parts = /^(\d)+\.(\d)+\.(\d)+/.exec(version);
if (parts) {
var major = parseInt(parts[1]);
if (major > 2) {
throw new Error("This module is not required for Node-RED 3 or later")
}
}
function JunctionNode(n) {
RED.nodes.createNode(this,n);
this.on("input",function(msg, send, done) {
send(msg);
done();
});
}
RED.nodes.registerType("junction",JunctionNode);
}