Last active
May 25, 2018 18:02
-
-
Save NickNaso/42ce5f0bcca434f8bd95a428e2d454c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict' | |
| const EventEmitter = require('events').EventEmitter | |
| const addon = require('bindings')('emit_from_cpp') | |
| const emitter = new EventEmitter() | |
| emitter.on('start', () => { | |
| console.log('### START ...') | |
| }) | |
| emitter.on('data', (evt) => { | |
| console.log(evt); | |
| }) | |
| emitter.on('end', () => { | |
| console.log('### END ###') | |
| }) | |
| addon.callEmit(emitter.emit.bind(emitter)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment