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

buddys-simple-timer

v0.0.9

Published

A Node-RED timing node designed to forward the payload after a specified delay in seconds. The timer resets upon receiving a new payload. Includes status indication for the scheduled trigger time.

Downloads

12

Readme

Buddy's Simple Timer

Buddy's Simple Timer is a Node-RED node designed to forward the incoming payload after a specified delay, measured in seconds. It's perfect for scenarios where you need to delay the flow of messages for a certain amount of time.

Features

  • Timer Reset: The timer resets and starts counting down again from the specified seconds each time a new payload is received.
  • Status Indication: Provides a visual status indication showing when the timer is set to trigger next.
  • Persistent Memory: Maintains the countdown state through Node-RED restarts or redeploys.
  • Immediate Execution: You can trigger the timer immediately by sending 0 in msg.timer_seconds, or stop the timer by sending "STOP" in msg.payload.

How to Use

  1. Connect this node to the nodes in your flow.
  2. Configure the delay by inputting the countdown time in seconds in the node settings.
  3. The timer will reset to the countdown with each new incoming payload.
  4. To override the duration dynamically, send a numerical value in msg.timer_seconds.

Node Configuration

  • Timer Seconds: Set the countdown time in seconds. This can also be dynamically set by passing a msg.timer_seconds property with a numerical value.

Inputs

  • msg.timer_seconds: A numerical value indicating the countdown time in seconds. If provided, this value overrides the static configuration set in the node properties.

Outputs

  • The node outputs the same payload it received, after waiting for the specified time.

Example Flow

Here's a simple example of how to use Buddy's Simple Timer in a flow:

[{"id":"338d3bc566e658b8","type":"comment","z":"fc864a2d8dd06829","name":"10 second timer","info":"","x":620,"y":300,"wires":[]},{"id":"8ae5fc10d4f542e5","type":"buddys-simple-timer","z":"fc864a2d8dd06829","name":"","timer_seconds":"10","x":600,"y":360,"wires":[["eefd52c4c980ddf9"]]},{"id":"eefd52c4c980ddf9","type":"debug","z":"fc864a2d8dd06829","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":800,"y":360,"wires":[]},{"id":"f5b7ab4366c08acd","type":"inject","z":"fc864a2d8dd06829","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"STOP","payloadType":"str","x":390,"y":400,"wires":[["8ae5fc10d4f542e5"]]},{"id":"0bf6bb98c826c0c3","type":"inject","z":"fc864a2d8dd06829","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"test","payload":"ON","payloadType":"str","x":390,"y":360,"wires":[["8ae5fc10d4f542e5"]]},{"id":"af3151c4a38e9d40","type":"inject","z":"fc864a2d8dd06829","name":"30 seconds","props":[{"p":"payload"},{"p":"msg.timer_seconds","v":"30","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":370,"y":320,"wires":[["8ae5fc10d4f542e5"]]}]