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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-red-contrib-context-consul

v0.1.1

Published

Node-RED Context storage plugin using Consul KV store

Downloads

20

Readme

node-red-contrib-context-consul

Consul context store for Node-RED.

Usage

Node-red contextStorage configuration needs to be added. The host, port, secure, ca, token, timeout, datacenter and consistent settings are just past through to Consul lib

contextStorage: {
	consul: {
		module: require("node-red-contrib-context-consul"),
		config: {				//see https://www.npmjs.com/package/consul#init for more info
			prefix: "mytest",		//all KV pairs are stored in path _nrcontext/[prefix]/ - see below
			host: "consul",			//IP or hostname of consul,
			port: 8500,			//listening consul port
			secure: false,			//TLS (https) secured?
			ca: {},				//TLS info -- ca (String[], optional): array of strings or Buffers of trusted certificates in PEM format
			//token: "something",		//Consul token if any to be included in all API calls
			timeout: 3000,			//API timeout in ms
			datacenter: "mydc",		//populates the dc option in all API calls
			consistent: true,		//consistency normal (false) or strong (true, default) - see Consul docs
			lock,				//EXPERIMENTAL - bool, default is no locking
			lockttl,			//(string: "") - Specifies the number of seconds (between 10s and 86400s).
			locknode,			//Specifies the name of the consul node. This must refer to a node that is already registered.
			lockdelay,			//(string: "15s") - Specifies the duration for the lock delay. This must be greater than 0.
			debug: false			//flag to enable console debug messages
		}
	}
}

When you fire up node-red up a series of checks will execute to ensure Consul is available and working as expected. If any of them fail an error is thrown and node-red will not start. The "prefix" is basically the node-red instance ID, all KV pairs will prefixed with _nrcontext/[prefix string] so multiple instances can make use of the same Consul cluster.

note - if you do not lock (still experimental) and run multiple instances using the same prefix you are asking for trouble and KV pairs may clash.

Testing

If you have docker available, run a then docker-compose up to bring up node-red with a basic consul cluster available to store context data.

More info

Check out these links for more info, Node-red Context Docs, Node-red Context API, Consul lib on NPM