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 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-red-contrib-flowswitch

v0.1.3

Published

A Node-RED node that allows messages to pass through based on on/off state

Readme

FlowSwitch Node for Node-RED

FlowSwitch is a custom node for Node-RED that allows you to control the flow of messages through your automation workflows. It acts as an switch: when on, it lets messages pass; when off, it blocks messages from continuing through. This makes it easy to dynamically enable or disable parts of your Node-RED flows without requiring a deploy.

Features

  • Dynamic control: Change the switch state via an input message.
  • UI indicator: Visual representation of the switch state (active/inactive) in the Node-RED editor.
  • Status output: A second output emits status changes (current on/off state).
  • Persistent state: The switch state can survive Node-RED redeploys and reboots when a persistent context store is configured.

Installation

To enable persistent state storage, add a persistent context store to your Node-RED settings.js. For example, to use the local filesystem store add:

contextStorage: {
    default: {
        module: "localfilesystem"
    }
},

Restart Node-RED after changing settings.js.

Usage

  • Send messages with msg.topic === "flowswitch" and set msg.payload to control the node.
    • Accepted payloads for ON: true, 1, "1", "ON", "On", "on", "yes"
    • Accepted payloads for OFF: false, 0, "0", "OFF", "Off", "off", "no"
    • Additional control commands:
      • toggle (case-insensitive): flip the current state.
      • query (case-insensitive): return the current state on the third output without changing it.
  • Outputs:
    1. First output: passes through the input message when the node is ON.
    2. Second output: emits last input message what received when node was ON
    3. Thirt output: emits a status message when the switch state changes (payload contains the new boolean state).
  • When the node is OFF, messages are blocked from the first output. The second output is used for state notifications.

Example Use Cases

  • Persistent UI switches: have a dashboard switch that retains its state across reboots and redeploys.
  • State source: maintain an authoritative on/off state for relays, automations or groups of flows.
  • Control gating: lock controls in a dashboard

License

This project is licensed under the MIT License.

Contribution

Contributions are welcome. Please fork the repository and submit a pull request to improve functionality or documentation.

Acknowledgements

This node was created to provide an easy way to maintain authoritative switch state and filter events across flows. It was adapted from ideas in the FlowGate node: https://github.com/gmag11/node-red-contrib-flowgate