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-contextbrowser

v0.0.4

Published

A node-red node to browse context variables.

Downloads

190

Readme

node-red-contrib-contextbrowser

Browse the current global, flow and node context in the sidebar. The addon is for node and function node developers to support debugging and runtime monitoring.

NodeRed

Contextbrowser in action

Features

Sometimes it is not appropriate to print a debug message, write to console and to flood it. The status information attached to nodes in the editor is limited in its size and shall concentrate on real state information to the working/task of the node.

On the other hand you may want to look into a long running system and monitor it. The context variables in node-red are a good space to share information like settings and states between different nodes and flows and they can be prefilled via functionGlobalContext in the node-red settings file or with node-red-contrib-config. With the feature of persistence on the roadmap of node-red context is getting more interesting as well to speed up initialization and continue working on error or to use it as a cache.

This node is a special node-red sidebar addon for debugging and runtime inspect the context variables on request for debugging purposes. It will give you the following benefits

  • provide information from the node runtime context to the editor/user
  • high performant as information is only transmitted to the editor on request
  • the context data is available on a API endpoints (e.g. /contextbrowser/node/:id) which allows further automated longterm monitoring of node runtime variables and integration into other monitoring solutions (like nagios or iacinga)

Install

Follow the node installation guide to the npm-package node-red-contrib-contextbrowser.

Note: This node requires a Node-RED version of at least 0.17.

npm install node-red-contrib-contextbrowser

Usage

Select a node on a workspace and open the "Context Browser" sidebar via the sidebar menu Now press the refresh button in the head of the sidebar pane to retrieve the current context data from the runtime. Each context for node, flow and the global context refresh individually.

Peter Scargill made a blog post as well what you can to with the nodes config and contextbrowser

Note: Context variables beginning with an underscore will be ignored (private variables)

Examples

You can load an example flow from the node-red examples menu, which will show you how you hide data from the contextbrowser by using the get/set operations of context and how to create intermediate debugging properties which are browsable.

Permissions

  • contextbrowser.flow.read for ./contextbrowser/flow/:id
  • contextbrowser.global.read for ./contextbrowser/global
  • contextbrowser.node.read for ./contextbrowser/node/:id

Changelog

NPM

Version 0.0.4

  • Getting context keys is supported starting with Node-RED 0.17.
  • ignoring keys starting with underscore (e.g. _myprivateVar)
  • you can open the context in a dedicated browser window
  • fix: correct size of tabs
  • removed node-red-contrib-config from example

Version 0.0.3

  • changed timestamp of context refresh from ticks to locale string

Version 0.0.2

  • ignore function properties in the context (will skip them from jsonify)

Version 0.0.1

First release for testing

TODOs / Ideas

  • get only a specific part of the context (like a filter). Helpful when you have bigger structures
  • provide a list of Ids which will not be accessible by contextbrowser in settings.js
  • test with alternative httpAdmin routes and authentication
  • auto refresh the selected context tab in a given interval
  • notify user that context data is old if the flow/affected node was deployed
  • mark persisted context properties (if feature is available in node-red, extend node-red-contrib-config with this feature)