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

@streamr/mqtt-streamr

v2.0.0

Published

Command-line utility for bridging data from MQTT to Streamr

Downloads

6

Readme

mqtt-streamr

A command line utility for bridging data from a MQTT broker to Streamr Network with stream auto-creation and other useful features. This utility is basically a script with a MQTT client and a Streamr light node, and some code to glue the two together.

Installation

npm install -g @streamr/mqtt-streamr

Usage

To get help, including a list of all the command-line options, simply run mqtt-streamr.

Minimal usage: mqtt-streamr --mqtt-url [mqtt-url] --topic [path] --private-key [key]

Required options

--mqtt-url [url]

The MQTT server URL to connect to, for example --mqtt-url wss://some-mqtt-server.com.

--topic [topic]

MQTT topic/path to subscribe to. Give this option multiple times to subscribe to several topics. Can include wildcards. Example: --topic /home/bedroom/lamp

--private-key [key]

Ethereum private key to use on the Streamr Network. If you don't have one, you can export a key from a wallet like Metamask or generate a private key here.

Additional options

--verbose

Give this option to print all the data to the console.

--public

Give this option to make all created streams publicly readable. By default, created streams are private to you.

--stream-name-template [template]

Default: $topic

Give this option to set how the stream name is constructed from the MQTT topic. The string $topic in the template is replaced by the actual topic. Example: My MQTT topic: $topic.

Note that you can direct all data go to a single stream by just defining its name without the placeholder $topic in it.

--stream-id [id]

If this option is given, all data will be published to a single pre-existing stream with this id. Topic auto-creation will be disabled.

--topic-levels [num]

Default: (unlimited)

Number of topic levels to include when auto-creating streams, while truncating subsequent topic hierarchy levels. For example, data in /europe/switzerland and /europe/finland would both be produced to stream /europe if the topic-level is set to 1.

--transform [jsonata-syntax]

Give this option to transform JSON messages before producing them to Streamr. This option follows the JSONata syntax. By default no transform is applied.

--log-interval [num]

Default: 60

Stats logging interval in seconds.

--reconnect-on-data-timeout [num]

Default: 900

If no data is received for this period of time, try to reconnect to the MQTT broker. The default is 15 minutes. Set to 0 to disable.

--dry-run

If this option is given, the script doesn't really create streams or produce data to Streamr. It just reads from the MQTT broker and logs the data to console.

License

AGPLv3, see LICENSE.

TODO

  • Utility for the other direction (Streamr to MQTT)