Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

make event nodejs

const events = require('events');

let emitter = new events.EventEmitter();

emitter.on('newEvent', (message)=>{
	
	console.log(`Message : ${message}`);
});

emitter.emit('newEvent', 'Hello guys, this is CodezUp');
Source by codezup.com #
 
PREVIOUS NEXT
Tagged: #event #nodejs
ADD COMMENT
Topic
Name
1+6 =