Skip to content
Newer
Older
100644 55 lines (40 sloc) 1.7 KB
3f5b53c @indutny First commit
authored
1 # node-evented
2
0878d52 @indutny Oops. big image!
authored
3 <img src="http://i.imgur.com/3kYWY.jpg" />
3f5b53c @indutny First commit
authored
4
5 ## Extended EventEmitter for node.js
6
7 I'll give you no description, code talks itself:
8 <pre>
9 var EventEmitter = require('node-evented').EventEmitter;
10
11 // Do as you usual do!
12 var obj = new EventEmitter();
13
14 obj.on('some-event', function() {
15 // Some code: starts
16 // ...
17 // Some code: ends
18
19 // This line removes current listener from EventEmitter !
20 this.removeListener('some-event');
21 });
22
23 obj.emit('some-event'); // Works!
24 </pre>
25
26 ## I like it! How to install ?
27 <pre>
28 npm install node-evented
29 </pre>
30
31 ### License
32
33 (The MIT License)
34
3098e7f @indutny Fixed license
authored
35 Copyright (c) 2010 Fedor Indutny
3f5b53c @indutny First commit
authored
36
37 Permission is hereby granted, free of charge, to any person obtaining
38 a copy of this software and associated documentation files (the
39 "Software"), to deal in the Software without restriction, including
40 without limitation the rights to use, copy, modify, merge, publish,
41 distribute, sublicense, and/or sell copies of the Software, and to
42 permit persons to whom the Software is furnished to do so, subject to
43 the following conditions:
44
45 The above copyright notice and this permission notice shall be
46 included in all copies or substantial portions of the Software.
47
48 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
49 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
51 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
52 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
53 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
54 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.