node-eventstore-client/README.md

66 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2016-03-09 19:52:01 +00:00
# eventstore-node
2016-03-09 20:46:15 +00:00
A port of the EventStore .Net ClientAPI to Node.js
2016-03-10 01:08:03 +00:00
## Dependencies
2016-03-09 20:46:15 +00:00
2016-03-10 01:08:03 +00:00
- Node.js >= 0.12
2016-03-17 06:15:25 +00:00
- Modules: [long](https://www.npmjs.org/package/long), [protobufjs](https://www.npmjs.org/package/protobufjs), [uuid](https://www.npmjs.org/package/uuid) (installed via `npm install`)
2016-03-09 20:46:15 +00:00
2016-03-09 23:37:08 +00:00
## Status
Unstable
2016-03-09 20:46:15 +00:00
2016-03-14 22:37:35 +00:00
### Missing features:
- Ssl connection
- Cluster connection
- Set system settings
### Incomplete
2016-03-09 20:46:15 +00:00
- 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
2016-03-17 06:15:25 +00:00
## Getting started
Install the client using npm
npm install eventstore-node
Examples
TODO
2016-03-09 20:46:15 +00:00
2016-03-10 01:08:03 +00:00
## Porting .Net Task to Node.js
I used Promise to replace .Net Task, so when executing an async command, i.e. appendToStream you'll have to wait for result/error like this:
connection
.appendToStream('myStream', client.expectedVersion.any, events, userCredentials)
.then(function(result) {
//Do something with the WriteResult here
})
.catch(function(err) {
//Handle error here
});
2016-03-09 23:37:08 +00:00
## Running the tests
2016-03-09 20:46:15 +00:00
2016-03-17 06:15:25 +00:00
To run the tests you will need
- To install the dependencies (`npm install`)
- To install nodeunit (`npm install -g nodeunit`)
- Run an instance of EventStore >= 3.3.0 (competing consumers are required for test) on localhost:1113 (Download [here](https://geteventstore.com/downloads/))
2016-03-09 20:46:15 +00:00
To execute the tests suites simply run test with npm
2016-03-10 01:08:03 +00:00
npm test
2016-03-09 23:37:08 +00:00
## License
2016-03-17 06:15:25 +00:00
Ported code is released under the MIT license, see [LICENSE](https://github.com/nicdex/eventstore-node/blob/master/LICENSE).
Original code is released under the EventStore license and can be found at https://github.com/eventstore/eventstore.