Git Product home page Git Product logo

event-store-node's Introduction

Event Store NodeJS Client (using HTTP API)

Quality Gate Status

Simple Event Store Client (using Rest HTTP API), based on Axios promises.

Event Store

Event Store is a service that allows us to store events in a TSDB way, but it also performs neatly as an EventBus for connecting multiple services within a platform or solution.

This client aims to aid in such efforts by providing an easy way to connect, post and subscribe to events.

More on EventStore at https://eventstore.com/

Requirements

  • node.js > 10
  • an Event Store running instance

Getting Started

npm i --save katesclau/event-store-node or yarn add katesclau/event-store-node

import EventStoreClient from '../src/index';
import { Entry, UserCreateInput, Direction, UserRole, EventStoreOptions } from '../@types/eventStore';

// Connection options
const options: EventStoreOptions = {
  url: 'http://localhost:2113',
  user: process.env?.EVENTSTORE_USER ?? 'admin',
  password: process.env?.EVENTSTORE_PASSWORD ?? 'changeit',
};

// Client instance
const client = new EventStoreClient(options);

// Post your event
const response = await client.postEvent('STREAM_NAME', 'EVENT_TYPE', {
    message: 'my first event'
});

Features

  • Post Event to Stream ✔
  • Subscribe to Streams (Using persistent subscribers) ✔
  • Read Stream Events (Historical & Conditional) ✔
  • User Management (CRUD) ✔

TODO

  • Projections (CRUD)
  • Misc (Description, Node info, Ping, Gossip...)
  • ACL Management (Streams metadata)

REST reference

PostMan Collection 🔗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.