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
|
|
|
|
|
|
2025-07-04 15:14:03 +02:00
|
|
|
module.exports = function (RED) {
|
2025-07-04 10:44:54 +02:00
|
|
|
// Register the node type
|
2025-07-04 15:14:03 +02:00
|
|
|
RED.nodes.registerType(nameOfNode, function (config) {
|
2025-07-04 10:44:54 +02:00
|
|
|
// Initialize the Node-RED node first
|
2025-06-12 11:55:17 +02:00
|
|
|
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
|
|
|
};
|