Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 69 lines (46 sloc) 2.508 kb
0f1ac91 Adriano Raiano first commit
authored
1 # Introduction
2
3 [![Build Status](https://secure.travis-ci.org/adrai/node-cqrs-eventdenormalizer.png)](http://travis-ci.org/adrai/node-cqrs-eventdenormalizer)
4
5 Node-cqrs-eventdenormalizer is a node.js module that implements the cqrs pattern.
6 It can be very useful as eventdenormalizer component if you work with (d)ddd, cqrs, domain, host, etc.
7
8 # Installation
9
e901cfa rename npm package
Adriano Raiano authored
10 $ npm install cqrs-eventdenormalizer
0f1ac91 Adriano Raiano first commit
authored
11
12 # Usage
13
14 ## Initialization
15
e901cfa rename npm package
Adriano Raiano authored
16 var contextEventDenormalizer = require('cqrs-eventdenormalizer').contextEventDenormalizer;
0f1ac91 Adriano Raiano first commit
authored
17
18 contextEventDenormalizer.on('event', function(evt) {
19 // send to clients
20 });
21 contextEventDenormalizer.initialize({
22 denormalizersPath: __dirname + '/eventDenormalizers',
23 extendersPath: __dirname + '/eventExtenders'
24 }, function(err) {
25
26 });
27
28 contextEventDenormalizer.denormalize({ id: 'msgId', event: 'dummyChanged', payload: { id: '23445' } }, function(err) {
29
30 });
31
32 ## Define eventdenormalizers...
33
34 var base = require('node-cqrs-eventdenormalizer').eventDenormalizerBase;
35
36 module.exports = base.extend({
37
38 events: ['dummied', {'dummyCreated': 'create'}, {'dummyChanged': 'update'}, {'dummyDeleted': 'delete'}],
39 collectionName: 'dummies',
40
41 dummied: function(evt, aux, callback) {
42 callback(null);
43 }
44
45 });
46
47 See [tests](https://github.com/adrai/node-cqrs-eventdenormalizer/tree/master/test) for detailed information...
48
49 # License
50
51 Copyright (c) 2012 Adriano Raiano
52
53 Permission is hereby granted, free of charge, to any person obtaining a copy
54 of this software and associated documentation files (the "Software"), to deal
55 in the Software without restriction, including without limitation the rights
56 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57 copies of the Software, and to permit persons to whom the Software is
58 furnished to do so, subject to the following conditions:
59
60 The above copyright notice and this permission notice shall be included in
61 all copies or substantial portions of the Software.
62
63 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
69 THE SOFTWARE.
Something went wrong with that request. Please try again.