Nodejs 笔记
Nodejs 笔记
event Module
const EventEmitter = require('events');
const eventEmitter = new EventEmitter();
//事件监听器
eventEmitter.on('tutorial',(num1,num2)=>{
console.log('tutorial event has occurred');
console.log(num1 + num2);
})
//发起tutorial事
原创
2020-06-30 22:41:24 ·
41975 阅读 ·
1 评论