npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-timeframerlt

v0.3.1

Published

A Trigger and Rate Limit Node to pass messages if user count has been met within a defined user time frame.

Downloads

154

Readme

node-red-contrib-timeframerlt (timeframe rate limit trigger)

Node-RED A Trigger and Rate Limit Node to pass messages if user count has been met within a defined user time frame.


Table of Contents


Install

Run the following command in your Node-RED user directory - typically ~/.node-red:

npm install node-red-contrib-timeframerlt

Usage

A Trigger and Rate Limit Node to pass messages if user count has been met within a defined user time frame. Just insert the node in between two others. Then the ammount of messages received in a certain time frame to trigger can be limited by different parameter selections.

Timeframe

Amount of time given before message trigger event is reset. For example: setting the node to 10 seconds means, that you have ten seconds to reach enough messages to trigger one message to be forwarded.

Count Persistent

Ammount of messages needed to trigger before one message is passed through. Persistent, If triggered the count is reset and it can be triggered again. For example: setting the node to a count of 5 means, that five messages are needed within the specified timeframe before one message will be forwarded.

Count Terminable

Will only pass through a single message, ONCE! Hence Terminable. When the ammount of messages needed active the trigger is reached. The trigger can be reset to send message when conditions are met again with msg.reset. For example: setting the node to a count of 5 means, that five messages are needed within the specified timeframe before one message will be forwarded Once, One time, and never again, even if conditions are met again.

Example Flows

Simple examples showing how to use the timeframerlt (timeframe rate limit trigger) and it's output.

Example by Count Persistent

example1.png

[{"id":"b0b8b22c.dd0f6","type":"inject","z":"99d92ba1.9f3598","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":160,"wires":[["2dbeb200.2d534e"]]},{"id":"d9a532a2.d8d81","type":"debug","z":"99d92ba1.9f3598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":470,"y":160,"wires":[]},{"id":"2dbeb200.2d534e","type":"timeframerlt","z":"99d92ba1.9f3598","name":"","throttleType":"count","timeLimit":"2","timeLimitType":"seconds","countLimit":"4","byresetcountLimit":"4","x":310,"y":160,"wires":[["d9a532a2.d8d81"]]}]

Example by Count Terminable

example2.png

[{"id":"b0b8b22c.dd0f6","type":"inject","z":"99d92ba1.9f3598","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":160,"wires":[["2dbeb200.2d534e"]]},{"id":"d9a532a2.d8d81","type":"debug","z":"99d92ba1.9f3598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":470,"y":160,"wires":[]},{"id":"2dbeb200.2d534e","type":"timeframerlt","z":"99d92ba1.9f3598","name":"","throttleType":"reset","timeLimit":"2","timeLimitType":"seconds","countLimit":"4","byresetcountLimit":"4","x":310,"y":160,"wires":[["d9a532a2.d8d81"]]},{"id":"f596a515.6d8208","type":"inject","z":"99d92ba1.9f3598","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":120,"wires":[["4296a6a.3809758"]]},{"id":"4296a6a.3809758","type":"change","z":"99d92ba1.9f3598","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":120,"wires":[["2dbeb200.2d534e"]]}]

Bugs / Feature request

Please report bugs and feel free to ask for new features directly on GitHub.

License

This project is licensed under Apache 2.0 license.

Work

_Need a node? _Need automation work? _Need computers to flip switches?

Contact me at [email protected]

Contributor of Project

Thanks to SunValleyFoods for being a buisness that supports opensource. They needed this node for a tempsensor monitoring and automation project for their freezers and cooers.

Thanks to allot of code written by Daniel 'Eisbehr' Kern and his node-red-contrib-throttle. I based and copied allot of code off his work as his node did not quite do what i needed.

release notes

0.0.0 = (majorchange) . (new_feature) . (bugfix-simple_mod)

version 0.2.4 First Public release

version 0.3.1 Added node.status icons and txt to show what the node was doing