Tips:
- 先注冊listener - on巾表,后emit
- Listener function 同步執(zhí)行
- 'on' is an alias of 'addListener'
- 'of' is an alias of 'removeListener'
- 常用:
- on\off\emit\once
- eventNames
- prependListener: 在array前面加listener = unshift
- rawListeners: 所有l(wèi)istener的function(包括once)
- max: 同event name上的listener>10個時,需要specific設置
- node inherit modules:stream.on(‘data’,()=>{}) \ process.on(‘exit’,()=>{})