How to create and use event emitter interface on Node.js add-ons
APACHE-2.0 License
Node.js includes an event system which is an implementation of the Observer pattern that is the most common used event pattern in Node.js application and for good reasons: it's incredibly simple and useful.
Anyone who has used Node.js should be familiar with events. This module has the responsability to facilitate the communication between objects of your application.
Much of the Node.js core API modules are built aroud an idiomatic asynchronous event-driven architecture in which certains kinds of objects (called emitter) periodically emit named events that cause Function objects ("listeners") to be called.
Sometimes you need to promote loose coupling system by ensuring that instead of components (modules) referring to each other explicitly, their interaction is handled through an exchange of message using the events. This can help to decouple the systems and improve the module reusability.
Here you can find a collection of examples where I used or implemented event emitter interface in a Node.js Native AddOns.
In each example directory, run:
$ npm install
$ node-gyp rebuild
$ node index.js or npm start
https://www.npmjs.com/~nicknaso
Thank you to all people that encourage me every day.
Licensed under Apache license V2