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

@ralphwetzel/node-red-context-monitor

v1.2.1

Published

A Node-RED node to monitor a context.

Downloads

38

Readme

@ralphwetzel/node-red-context-monitor

A Node-RED node to monitor a context.

What it does

This node allows to setup the reference to a context, then sends a message when this context is written to.

It sends a dedicated message on a separate port in case it detects that the value of the context was changed.

The message sent will carry the current value of the context as msg.payload, the context key as msg.topic.

Monitoring details will be provided as msg.monitoring:

  • The monitoring setup: scope & key always, flow (id) / node (id) if applicable.
  • The id of the node that wrote to the context as source.

The message sent off the change port carries an additional property in msg.monitoring:

  • The value overwritten as previous.

It is possible to monitor an infinite number of contexts with each instance of this node.

This node supports the three context scope levels Global, Flow & Node.

Installation

Use the Node-RED palette manager to install this node.

Details

To monitor a Global scope context, set the scope to Global and provide the context key.

To monitor a Flow scope context, set the scope to Flow, then select the owning flow and provide the context key.

To monitor a Node scope context, set the scope to Node, then select flow & node and provide the context key.

Hint: This node doesn't create a context. It just tries to reference to those already existing. If you're referencing a non-existing context, no harm will happen.

Monitoring objects stored in context

You may of course define a setup that monitors objects stored in context.

If you create a reference to this object (stored in context) and write to its properties, this node issues its messages accordingly.

Disclaimer: Monitoring changes to elements of an Array currently is not supported.

Example:

Monitoring context definition:

Code in a function node:

    // suppose, test_flow = { prop: "value" }
    let obj = flow.get("test_flow");
    obj.prop = "new";

Message sent by the node:

Object property monitoring

You may define a setup that doesn't monitor the (whole) object, but only one of its properties:

Such a monitor will react only, when this property and - if it's an object - its child properties are written to.