![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
event-sourcerer-client
Advanced tools
Event Sourcing client
This client would be in charge of handling publishing of events to the event sourcing service.
The intent is for this client to be an abstraction over whatever protocol/transport/service we decide to use for event publishing and consumption.
const Jackrabbit = require('jackrabbit');
const EventSourcerer = require('@pager/event-sourcerer-client');
const Client = EventSourcerer.Client;
const SingleKeyRabbitTransport = EventSourcerer.transports.SingleKeyRabbit;
const rabbit = Jackrabbit('amqp://localhost')
const transport = new SingleKeyRabbit(rabbit, { exchangeName: 'pager' })
const client = new Client(transport)
const stream = 'chats'
const streamId = '123456'
const eventType = 'created'
const data = { 'name': 'my chat' }
client.publish(stream, streamId, eventType, data)
Client(transport)
transport
- an instance of an object with a publish function that implements actual publishing of messages.publish(stream, streamId, eventType, data)
stream
- Name identifying the type of the stream, the stream is the category name to which we publish messages, analog to a model/entity name.streamId
- Identifier for a particular instance of the streameventType
- Name of the event.data
- An object with fields and values for the eventThis transport can be used to publish messages to a RabbitMQ instance, under a single key by stream. The key being events.{stream}.created
.
SingleKeyRabbitTransport(rabbitConnection, options)
rabbit
- Configured connection to rabbit, as the one returned by @pager/jackrabbit
or a compatible one.options
- settings:
exchangeName
- name of the RabbitMQ exchange. Required.exchangeType
- Type of exchange. Optional. Possible values: topic
, default
. Defaults to topic
This transport can be used to publish messages to a RabbitMQ instance, where every event is published to it's own key. The key being {stream}.{eventType}
.
MultiKeyRabbitTransport(rabbitConnection, options)
rabbit
- Configured connection to rabbit, as the one returned by @pager/jackrabbit
or a compatible one.options
- settings:
exchangeName
- name of the RabbitMQ exchange. Required.exchangeType
- Type of exchange. Optional. Possible values: topic
, default
. Defaults to topic
This transport can be used to publish messages to a RabbitMQ instance, under a single key by stream. The key being events.{stream}.created
.
SingleKeyRabbitTransport(rabbitConnection, options)
rabbit
- Configured connection to rabbit, as the one returned by @pager/jackrabbit
or a compatible one.FAQs
event-sourcerer client
The npm package event-sourcerer-client receives a total of 1 weekly downloads. As such, event-sourcerer-client popularity was classified as not popular.
We found that event-sourcerer-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.