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

v0.0.3

Published

Node-RED nodes for Zyre - an open-source framework for proximity-based peer-to-peer applications.

Downloads

12

Readme

node-red-contrib-zyre

Node-RED nodes for Zyre - an open-source framework for proximity-based peer-to-peer applications.

Relies on the zyre.js and zeromq packages. Note: The zeromq package can take time to compile if pre-built binaries are not available.

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

npm install node-red-contrib-zyre

Setup

Drag any Zyre node onto the palette to create a zyre peer. Click edit on the Zyre Peer field to set up a new node. The defaults are usually sufficient, but see the following for information about each field.

Name: The name of the zyre peer config node. Note: This also controls the name of the peer itself unless the environment variable ZYRE_PEER_NAMES is set, in which case the actual name is randomly chosen from the comma-delimited list.

Port: The ZRE UDP-beacon broadcast port can be changed if desired to create a new Zyre network.

Evasive: The number of milliseconds before a peer is considered evasive.

Expired: The number of milliseconds before an evasive peer is considered expired. After this long, the expired event is fired.

Interval: The number of milliseconds between UDP-beacon broadcasts. The connect event is fired when new nodes are discovered.

Groups: A comma-delimited list of groups to join on start-up.

Headers: A JSON-string containing key/value headers sent with the ZRE HELLO message for the connected event.

Encoding: The payload encoding of received messages. Defaults to utf8. Available values are: ascii, utf8, utf16le/ucs2, base64, binary, or hex. Use raw to receive raw buffers.

Input

All Zyre nodes can be used for input. For presence nodes (connect, disconnect, expired, join, and leave), the payload is a JSON object containing information about the event. The identifier or name of the peer from the event can be used to send a zyre-whisper (see below).

  • zyre connect: identity, name, headers
  • zyre disconnect: identity, name
  • zyre expired: identity, name
  • zyre join: identity, name, group
  • zyre leave: identity, name, group

For messaging nodes (whisper, shout), the payload is either a JSON object, a string, or a raw buffer (if encoding is set to raw on the zyre peer config node). In addition, the information about the event is sent as additional fields on the msg.

  • zyre whisper: topic, identity, name (topic is the identity of the sender)
  • zyre shout: topic, identity, name (topic is the name of the group)

For input, set the topic to the name of another zyre peer or the name of a group to filter input.

Output

The join, leave, whisper, and shout nodes can be used for output.

  • zyre join: Uses either the topic on the msg, topic on the node, or payload on the msg to join a group.
  • zyre leave: Uses either the topic on the msg, topic on the node, or payload on the msg to leave a group.
  • zyre whisper: Uses either the topic on the msg or topic on the node to whisper another peer on the network. The topic can be set to either the identity or name of the peer.
  • zyre shout: Uses either the topic on the msg or topic on the node to shout to a group.