Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
* IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
* MERCHANTABLITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*
* Contributors - initial API implementation:
* Nicola Del Gobbo
******************************************************************************/
'use strict'
const EventEmitter = require('events').EventEmitter
const NativeEmitter = require('bindings')('native_emitter').NativeEmitter
const inherits = require('util').inherits
inherits(NativeEmitter, EventEmitter)
const emitter = new NativeEmitter()
emitter.on('start', () => {
console.log('### START ...')
})
emitter.on('data', (evt) => {
console.log(evt)
})
emitter.on('end', () => {
console.log('### END ###')
'use strict'
const EventEmitter = require('events').EventEmitter
const NativeEmitter = require('bindings')('native_emitter').NativeEmitter
const inherits = require('util').inherits
inherits(NativeEmitter, EventEmitter)
const emitter = new NativeEmitter()
emitter.on('start', () => {
console.log('### START ...')
})
emitter.on('data', (evt) => {
console.log(evt)
})
emitter.on('end', () => {
console.log('### END ###')