UNPKG

node-red-contrib-netvar-utils

Version:

Network Variable List utility nodes for node-red

17 lines 613 B
"use strict"; const util_1 = require("../shared/util"); const nodeInit = (RED) => { function NvlHeaderNodeConstructor(config) { RED.nodes.createNode(this, config); this.on('input', (msg, send, done) => { if (!(msg.payload instanceof Buffer)) return done(new TypeError('Expected payload to be Buffer.')); msg.payload = util_1.readPacketHeader(msg.payload); send(msg); done(); }); } RED.nodes.registerType('nvl-header', NvlHeaderNodeConstructor); }; module.exports = nodeInit; //# sourceMappingURL=nvl-header.js.map