UNPKG

node-red-contrib-object-hash

Version:

A Node-RED node for generate hashes from objects and values in node.

16 lines (13 loc) 361 B
const hash = require("object-hash"); module.exports = function (RED) { function objectHash(config) { RED.nodes.createNode(this, config); var node = this; this.on('input', function(msg) { const { payload, options } = msg msg.payload = hash(payload, options || {}); node.send(msg); }); } RED.nodes.registerType("object-hash", objectHash); }