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

@parasaurolophus/node-red-dnssd

v3.1.3

Published

Wrap dnssd package for Node-RED

Downloads

41

Readme

@parasaurolophus/node-red-dnssd

Wrap @gravitysoftware/dnssd for use in Node-RED.

This provides a superset of the functionality supported by node-red-node-discovery, without generating any warnings in the Node-RED log.

Tested with Node-RED 3.1 running on Node.js 20.x. May not be compatible with older versions.


dnssd-advertisement

Input

msg.payload.command specifies a dnssd.Advertisement method to invoke:

start

Start responding to service enquiries from browsers.

{ "payload": {
        "command": "start"
        [, "service": name]
        [, "udp": boolean]
        [, "port": number]
        [, "options": json]
    }
}

If the optional service name, udp, port number or options values are provided, they will override the node's configuration.

stop

Broadcast a "service down" event.

{ "payload": { "command": "stop" } }

updateTXT

Update the TXT record. (Note that this is provided for completeness but is of limited utility since it does not trigger any of the events exposed by the dnssd.Browser object.)

{
    "payload": {
        "command": "updateTXT",
        "txt": {
            "foo": "bar"
        }
    }
}

Outputs

  1. Stream of Advertiser.instanceRenamed() events
  2. Stream of Advertiser.hostRenamed() events
  3. Stream of Advertiser.stopped() events
  4. Stream of Advertiser.error() events

dnssd-browser

Input

msg.payload.command specifies a dnssd.Browser method to invoke:

start

Begin listening for service life-cycle events.

{
    "payload": {
            "command": "start"
            [, "service": name]
            [, "udp": boolean]
    }
}

If the optional service name or udp values are provided, they will override the node's configured values.

stop

Stop listening for service life-cycle events.

{ "payload": {  "command": "stop" } }

list

Send a list of running services.

{ "payload": {  "command": "list" } }

Outputs

  1. Stream of Browser.serviceUp() events
  2. Stream of Browser.serviceDown() events
  3. Stream of Browser.error() events
  4. Browser.list() results

Details

This is a deliberately thin wrapper around the functionality exposed by @gravitysoftware/dnssd, which is a pure JavaScript implementation of DNS-SD.

The Service configuration string is the name of the DNS-SD service to broadcast using dnssd-advertisement or watch using dnssd-browser.

By default, these nodes will use TCP. The Use UDP? configuration checkbox tells them to use UDP instead.

dnssd-advertisement also requires a Port number and can optionally take Options, including a txt record. Options may be specified using JSON or JSONata.

These nodes do not start automatically even if they are fully configured. Use inject nodes configured to send messages when flows are (re-) started if required for your purposes.