Go to file
2016-10-20 04:40:46 -07:00
samples Bumping version to 0.0.7, exposing loggers, minor bug fixes, cluster connection (wip) 2016-10-20 04:40:46 -07:00
src Bumping version to 0.0.7, exposing loggers, minor bug fixes, cluster connection (wip) 2016-10-20 04:40:46 -07:00
test Bumping version to 0.0.7, exposing loggers, minor bug fixes, cluster connection (wip) 2016-10-20 04:40:46 -07:00
.gitignore Adding tests 2016-10-14 22:53:23 -07:00
index.js Adding tests 2016-10-14 22:53:23 -07:00
LICENSE Initial commit 2016-03-09 11:52:01 -08:00
package.json Bumping version to 0.0.7, exposing loggers, minor bug fixes, cluster connection (wip) 2016-10-20 04:40:46 -07:00
README.md Implemented connection to cluster using gossip seeds 2016-10-15 15:41:25 -07:00
webpack.config.js using webpack to generate a distribution version in ./lib/dist.js 2016-03-09 17:03:26 -08:00

eventstore-node

A port of the EventStore .Net ClientAPI to Node.js

Dependencies

Status

Unstable

Missing features:

  • Ssl connection
  • Cluster connection
  • Set system settings

Incomplete

  • Typed errors: currently most errors are direct instance of Error, which is not practical for error handling
  • Performance: there's still some while loop in the code that could be problematic with node.js
  • Tests: tests are only covering happy path scenarios for now

Getting started

Install the client using npm

npm install eventstore-node

Examples

TODO

Porting .Net Task to Node.js

.Net Task have been replace with Promise. When executing an async command, i.e. appendToStream you can use then/catch to wait for result/error.

Example

connection
  .appendToStream('myStream', client.expectedVersion.any, events, userCredentials)
  .then(function(result) {
    //Do something with the WriteResult here
  })
  .catch(function(err) {
    //Handle error here
  });

Running the tests

To run the tests you will need

  • To install the dependencies (npm install)
  • Run an instance of EventStore >= 3.3.0 (competing consumers are required for test) on localhost:1113 (Download here)

To execute the tests suites simply run test with npm

npm test

License

Ported code is released under the MIT license, see LICENSE.

Original code is released under the EventStore license and can be found at https://github.com/eventstore/eventstore.