Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-msg-counter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-msg-counter

A Node-RED node that counts messages that pass through it

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-red-contrib-msg-counter

This is a Node-RED node that counts messages passing through it.

Description

The msg-counter node is an easy way to monitor and count the flow of messages in your Node-RED applications. Each time a message passes through this node, it increments a counter and sends the message as a JSON payload which includes the message's payload, topic, and the current count. If the node receives a message with the topic 'resetCounter', it resets the counter to 0. If it receives a message with the topic 'msgCount', it sends a message with the count value in the payload.

The current count value is also displayed in the node status in the Node-RED editor.

Potential Uses

The msg-counter node can be particularly useful in the following scenarios:

  1. Debugging and Development: Keeping track of how many messages have passed through a particular point in your flows can help identify issues and understand the behavior of your flows.

Installation

To install this node, you can either install it from the Node-RED palette manager or run the following command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-msg-counter

Usage

Once the node is installed, it will appear in the Node-RED palette. You can then drag and drop it onto your flow canvas. Any messages that pass through the node will increment the counter and be enriched with a count property.

Author

  • Harshad Joshi - Initial work - GitHub

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

Potential ToDo

  1. Rate Limiting: You could use this node to implement basic rate limiting by keeping track of how many messages are being processed and taking action if the count exceeds a certain threshold.

  2. Message Sampling: In cases where you're dealing with a high volume of messages and only need to process a sample, this node could be used to only process every Nth message.

Keywords

FAQs

Package last updated on 17 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc