Files
reactor/advanced-reactor.js

13 lines
523 B
JavaScript
Raw Normal View History

2025-07-04 10:44:54 +02:00
const nameOfNode = "advanced-reactor"; // name of the node, should match file name and node type in Node-RED
const nodeClass = require('./src/nodeClass.js'); // node class
module.exports = function (RED) {
2025-07-04 10:44:54 +02:00
// Register the node type
RED.nodes.registerType(nameOfNode, function (config) {
2025-07-04 10:44:54 +02:00
// Initialize the Node-RED node first
RED.nodes.createNode(this, config);
2025-07-04 10:44:54 +02:00
// Then create your custom class and attach it
this.nodeClass = new nodeClass(config, RED, this, nameOfNode);
});
2025-06-12 12:52:32 +02:00
};