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

@superhero/eventflow-hub

v4.7.24

Published

Eventflow hub is the central server component in the eventflow ecosystem.

Readme

Eventflow Hub

Eventflow Hub is a central component of the Eventflow system that manages mTLS-secured connections between spokes and peer hubs, facilitating message publishing, subscription handling, and event scheduling.

[!NOTE] This module is still under development and in activing testing.

Features

  • TLS-Secured Communication: Ensures secure connections using certificates for both server and client communication.
  • Event Management: Publishes and broadcasts events to subscribed spokes and peer hubs.
  • Subscriber Management: Tracks spokes subscribing to specific events.
  • Scheduled Events: Executes scheduled tasks with error handling and persistence.
  • Scalable Architecture: Supports multi-hub communication for distributed systems.

Testing

Run the test suite using:

npm run test-build
npm test

Test Coverage

▶ @superhero/eventflow-hub
  ▶ Lifecycle
    ✔ Can initialize EventflowHub correctly (239.24859ms)
  ✔ Lifecycle (240.434564ms)

  ▶ Connections and Communication
    ▶ Handles spoke connections
      ✔ Broadcasts peer hub online event (6422.456966ms)
    ✔ Handles spoke connections (12880.167996ms)
  ✔ Connections and Communication (12880.634724ms)
✔ @superhero/eventflow-hub/hub (13122.085188ms)

▶ @superhero/eventflow-hub/manager/spokes
  ✔ Add and retrieve all sockets (3.451128ms)
  ✔ Delete a socket (0.227951ms)
  ✔ Destroy all sockets (0.352411ms)
  ✔ Handle deleting non-existent socket gracefully (0.275818ms)
  ✔ Return empty array if no sockets exist (0.165647ms)
✔ @superhero/eventflow-hub/manager/spokes (6.103143ms)

▶ @superhero/eventflow-hub/manager/subscribers
  ✔ Add and retrieve subscribers (2.384233ms)
  ✔ Handle wildcard subscribers (0.308446ms)
  ✔ Return empty array if no subscribers exist (0.152296ms)
  ✔ Delete a subscriber and clean up empty structures (0.243432ms)
  ✔ Clean up domain and event mappings after deletion (0.226052ms)
  ✔ Not throw errors when deleting non-existent subscribers (0.362547ms)
✔ @superhero/eventflow-hub/manager/subscribers (5.36466ms)

tests 14
suites 5
pass 14

-------------------------------------------------------------------------------------------------------------
file                    | line % | branch % | funcs % | uncovered line
-------------------------------------------------------------------------------------------------------------
config.js               | 100.00 |   100.00 |  100.00 | 
index.js                |  73.36 |    74.42 |   74.07 | 44-47 120-124 144-146 150-154 157-161 183-185 254-2…
index.test.js           | 100.00 |   100.00 |  100.00 | 
manager                 |        |          |         | 
 spokes.js              | 100.00 |   100.00 |  100.00 | 
 spokes.test.js         | 100.00 |   100.00 |  100.00 | 
 subscribers.js         |  78.21 |   100.00 |   83.33 | 61-77
 subscribers.test.js    | 100.00 |   100.00 |  100.00 | 
-------------------------------------------------------------------------------------------------------------
all files               |  82.97 |    86.32 |   87.50 |
-------------------------------------------------------------------------------------------------------------

License

This project is licensed under the MIT License.

Contributing

Feel free to submit issues or pull requests for improvements or additional features.