GitXplorerGitXplorer
N

addon-event-emitter

public
19 stars
5 forks
0 issues

Commits

List of commits on branch master.
Unverified
5156f0af3b46fdd7a392a09d20c2fdcee882f2e7

Removed unused code

NNickNaso committed 6 years ago
Unverified
0985f64c546500d8def491e6f78fd9824edef4dc

Removed unused file and fix documentation

NNickNaso committed 6 years ago
Unverified
f9ebf64d754842b0e7e192bb10b6c6554f225951

First rough example on calling function from worker thread

NNickNaso committed 6 years ago
Unverified
01325f737fb4d2daad69eb0a04e05f56c6a085b9

Typo in documentation

NNickNaso committed 6 years ago
Unverified
d7e37899c41d5f0b3f62a428a4c28d68398144db

Completd documentation

NNickNaso committed 6 years ago
Unverified
dcbf81261efbb7028a51bf16fb95af004bd7ab25

Removed unused resource

NNickNaso committed 6 years ago

README

The README file for this repository.

Event Emitter on Node.js Native Addons using N-API

How to create and use Event Emitter on Node.js Native Addons

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

Examples

Node.js C / C ++ Addons

N-API

Node Addon API

Header-only C++ wrapper classes for the ABI-stable Node.js API

Web resources

Nicola Del Gobbo

https://github.com/NickNaso/

https://www.npmjs.com/~nicknaso

https://twitter.com/NickNaso

Acknowledgements

Thank you to all people that encourage me every day.

License

Licensed under Apache license V2