Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
![Gitter](https://badges.gitter.im/Join Chat.svg)
A nodejs client library for (Get) Event Store
Want to help out? Check out a waiting issue
This client assumes that you already have an Event Store instance running.
Install
$ npm install ges-client
Append and read from an event stream
var ges = require('ges-client')
// 1) Create a connection to a running EventStore
// using default connection options and credentials
var connection = ges()
, stream = 'intro-events'
// 2) Append events that can be read
connection.on('connect', function() {
var appendData = {
expectedVersion: ges.expectedVersion.emptyStream
, events: [array of events]
}
connection.appendToStream(stream, appendData, function(err, appendResult) {
if(err) return console.log('Ooops!', err) // connection error
// 3) Read first events from the stream
connection.readStreamEventsForward(stream, { start: 0, count: 1 }, function(err, readResult) {
if(err) return console.log('Ooops!', err) // connection error or stream does not exist
// ta da!
console.log(readResult.Events)
})
})
})
Subscribe to stream updates
var ges = require('ges-client')
// 1) Create a connection to a running EventStore
// using default connection options and credentials
var connection = ges()
, stream = 'intro-events'
// 2) Create a subscription
connection.on('connect', function() {
var subscription = connection.subscribeToStream(stream)
// 3) Listen for events
subscription.on('event', function(evt) {
// ta da!
console.log(evt)
})
var appendData = {
expectedVersion: ges.expectedVersion.emptyStream
, events: [array of events]
}
connection.appendToStream(stream, appendData, function(err, appendResult) {
if(err) return console.log('Ooops!', err) // connection error
})
})
Copyright (c) 2014 Brian Mavity.
ges-client is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
Special thanks to Ken Pratt for writing the first version of this over at https://github.com/kenpratt/nodejs-EventStore . It made early development go by much faster.
FAQs
(Get) EventStore Client
The npm package ges-client receives a total of 6 weekly downloads. As such, ges-client popularity was classified as not popular.
We found that ges-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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.