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

@doughtnerd/message-store-connector

v1.10.1

Published

NodeJS client library for Eventide Project's Message DB

Downloads

154

Readme

Message Store Connector

These docs are under active development, as the library develops, better docs will be added.

Build and Deploy Workflow

npm version

Global Coverage Function Coverage Branch Coverage Lines Coverage Statement Coverage

What is it?

NodeJS library to connect to and operate on Eventide Project's Message DB.

Why is it?

A long time ago, in a galaxy far far away I worked at a company that used Event Sourcing and CQRS - specifically utilizing Eventide's Message DB. In that company we had a JS Message DB client library supporting usage of Message DB. I really enjoyed using that library and couldn't find a better equivalent in the wild. Since I've now left that company and the proprietary library behind, I figured it would be a good idea to make my own library to facilitate my personal usage of Message DB in hobby projects.

How do I use it?

Installation

Via npm

npm install @doughtnerd/message-store-connector

Via yarn

yarn add @doughtnerd/message-store-connector

Code Usage

Connect

Everything starts with a connection. Specifically the main export of the library is this connect function:

import { connect } from '@doughtnerd/message-store-connector';

The connect function takes a single config argument, which looks like this:

const messageStoreConfig = {
  messageStoreHost: 'localhost', // Or wherever your MessageDB is
  messageStorePassword: 'password', // Or whatever your actual password is
  logger: console, // The logger you want the library to use internally
};

Put it all together and you have this:

import { connect } from '@doughtnerd/message-store-connector';

const messageStoreConfig = {
  messageStoreHost: 'localhost', 
  messageStorePassword: 'password', 
  logger: console, 
};

connect(messageStoreConfig).then(messageStore => {
  // Do the things!
})

Call all the functions!

The library supports most of the MessageDB interactions listed here Once you have your connection, you can use the messageStore object to interact with your MessageDB.

connect(messageStoreConfig).then(async (messageStore) => {
  const streamName = 'rickRoll-43cf527b-0fa1-433f-bad0-6834b927e243'

  const event = {
    id: '42b85f29-088e-4c53-8ba8-e2ffa9a239ea',
    type: 'UserWasRickRolled',
    data: {
      neverGonna: [
        'Give you up',
        'Let you down',
        'Turn around and forget you'
      ]
    },
    metadata: {}
  }

  await messageStore.writeMessage(streamName, event)
})