Skip to content

Lightweight asynchronous message passing for NodeJS.

License

Notifications You must be signed in to change notification settings

jdwije/blabbermouth

Repository files navigation

Blabbermouth

Lightweight asynchronous message passing for NodeJS.

Quick Start

npm i -save @jdw/blabbermouth
// es6
import { Blabbermouth } from '@jdw/blabbermouth';

// or es5...
const Blabbermouth = require('@jdw/blabbermouth').Blabbermouth;

const bm = new Blabbermouth();

// A quick pub-sub example
bm.createTopic({
    id: 'topic.id',
    description: 'Give the topic an extended description',
   })
  .register('topic.id', async (topicId, event) => {
      const { content, uuid, date } = event;
      console.log(content.message);
  })
  .publish(
    'topic.id',
    { message: 'Asynchronous messaging in action!' }
  );

The above example will produce the following message "Asynchronous messaging in action!" on your command line.

Contributing

About

Lightweight asynchronous message passing for NodeJS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published