addon-emitter
event emitter class for native addons.
usage
using a native addon (here foo
) with event emitter:
var Foo =var foo =foo
the Foo
class inherits the public interface of the Emitter
class:
// foo.h// inherit from the Emitter class;
set the method for the event listening (usually the on
method):
// foo.ccvoid
to emit an event from Foo
:
void
the example above is just to show what you have to do to use the module. it's not a fully functioning program. for a working example check the test
folder.
install
npm i addon-emitter
in binding.gyp
:
{'include_dirs': [ "<!(node -e \"require('addon-emitter')\")" ]}