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

v1.2.1

Published

A node-red node to set flow and global context values at start up.

Downloads

2,471

Readme

node-red-contrib-config

A Node Red node for setting global and flow context properties at startup and during runtime.

This node allows you to store configuration information in a central location and use it to set global and flow context properties at startup (initialization phase) or during runtime. Multiple config nodes can be used to store alternate configuration settings and switch between them during runtime.
node-appearance
Fig. 1: Node appearance

Installation

In Node-RED

  • Via Manage Palette -> Search for "node-red-contrib-config"

In a shell

  • go to the Node-RED installation folder, e.g.: ~/.node-red
  • run npm install node-red-contrib-config

Usage

Node Configuration

node-settings
Fig. 2: Node properties

Configuration of Property and Value

The object given in the Property field is the context property which shall be modified. This object can be a global or a flow variable.
The contents of the Value field is the data which is written to the context property object. This object can be of the type

  • string
  • number
  • boolean
  • JSON
  • timestamp

Checkbox Active

If Active is checked (i.e. node is active), the configuration properties will be applied at startup before any flows are started. This may e.g. be used for initialization purposes.

Input

If the node receives any msg, it will apply the configuration properties contained in that config node. I.e. the value of the Value field is written into the variable given in the Property field. The received msg is discarded.
This allows e.g. to alter configurations programmatically.

Pressing the button on the left side of the node will also apply the configuration properties contained in that config node.
This allows also to alter configurations manually.

Output

The config node has no output data.

Example


Remark: Example flows are present in the examples subdirectory. In Node-RED they can be imported via the import function and then selecting Examples in the vertical tab menue.


The example flow shows an example where the global variable PC_Stability

  • is modified at startup (initial operation, only by the upper config node),
  • can be modified by the left button of both config nodes (manual operation),
  • can be modified by the upper both inject nodes (msg initiated operation).

The lower nodes only show the contents of the modified global variable.

ConfigNodeExampleFlow.json

Fig. 3: Config node example

The following figure shows the node configuration of the upper confignode.

Fig. 4: Example Config node properties