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

event-driven

v1.0.56

Published

makes building event-driven-architecture easy

Downloads

1,976

Readme

event-driven

'event-driven' library aims to simplify building backends in an event driven style(event driven architecture). For message broker, light weight NATS JetStream is used and for event store, the well known NoSQL database, MongoDB, is used. Note that event store stores all commands, events, their errors, and also some other analytical data used for monitoring. The errors stored in the event store is also used as a dead letter queue(DLQ), which is a crucial feature when implementing event driven architecture.

Included features

  • Store command(operation) events
    A command(ex. GraphQL Mutation, POST request) initiates the "event flow(chain)"
  • Publish & Subscribe with at least once delivery
  • Horizontal scaling for subscription(fan out by using consumer groups)
  • Retry Logic with acknowledgement
    If the consumer does not acknowledge within a configured duration, the message borker pushes the event again to the consumer
    // terminal
    Event! - [User-nameUpdated]
    Event! - [Blog-userUpdated]
    Failed 1 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Failed 2 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Failed 3 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Failed 4 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Failed 5 times, clientGroup: Comment, errMsg: Test Error!! eventId:622303733628c902f133004b
    Error added to dead letter queue
  • Dead Letter Queue(DLQ)
    If the consumer fails to acknowledge the event for more than 5 times, it is removed(acknowledged) from the event stream and stored in DLQ.
  • Event Management
    • list of events of all subjects
    • full event chain visualization for each command event-chain
    • Check error message and retry failed consumption from DLQ dead-letter-queue

How to get started

Detailed documents will come soon. For now here is a full boilerplate that uses the 'event-driven' library to build a very simple backend for a blog service.

Roadmap

  • Library documentation
  • Slack Webhook when DLQ receives new errors
  • Duplicate the event data($out) to a cheap file storage, AWS S3
  • Apply TTL to event data in event store(mongodb), to keep the storage size in a reasonable size.
  • Able to replay/query "all" events. Use MongoDB Data Lake to replay/query from "all" events
  • Dashboard - full event chain visualization summary for each "subject"
  • Event Version Control
    • Each event should store a version number
    • When version is upgraded, provide a function that updates old event data to the newest version
  • Able to smoothly split a single module into multiple modules
  • Able to OperationInit to none request initiation, such as external event subscription/webhook etc.