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

manuh-rn

v1.3.0

Published

A lightweight client-side topic infrastructure inspired by MQTT pub-sub interface

Downloads

7

Readme

manuh

A lightweight client-side topic infrastructure inspired by MQTT pub-sub interface to empower frontend event-based interactions. With manuh you can build one-way data flow UI without switch-cases, actions, stores, reducers, etc. In fact, manuh is an alternative to EventEmitter, but with the MQTT protocol steroids.

One-way data flow

With or without manuh you should keep in mind the importante of one-way data flow to your applications, specially when they have views with lots of components and starts to have performance issues. Here is an example of a UI with and without manuh.

Without manuh (and one way data flow), when the component is clicked, the setState of the overall view is invoked:

Without manuh

With manuh (and one way data flow), the communication between the clicked component and the opening canvas component is made on a pub/sub fashion, and only the canvas component setState is invoked

With manuh

Important changes

1.0.0 interface break

Until version 1.0.0 the subscribe method didn't had a target parameter, identifying the instance that made the subscription. It was introduced in this version so the subscription can be removed by the subscriber without using any other type of ID generation method or something like this. There's another approach to solve this problem that is returning an subscription ID when the subscription is made so the subscriber could unsubscribe using this ID. For the sake of simplicity, we decied to use an instance based identification, but this introduced an interface break because now the subscription has 3 parameters instead of 2.

1.2.x wildcards and async subscription now supported! =)

You can now subscribe with # wildcard, just like a good ol' MQTT subscription The + isn't supported yet, ¯_(ツ)_/¯

Also, if you provide a callback onsubscribed in the last parameter, the subscription will be made asynchronously

1.3.x subscription now returns the retained value and the callback receives an extra info parameter

When you invoke the subscription method syncronously, it will return the retained value - if there is one. The callback function of the subscription method now returns the message received and an info parameter that can have some additional info of the message. The first one is an attribute indicating whether the message was a retained message or not.