> For the complete documentation index, see [llms.txt](https://easonwang.gitbook.io/class/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easonwang.gitbook.io/class/eventemitter-shi-jian-chu-fa.md).

# EventEmitter(事件觸發)

EventEmitter 為Node.js核心模組events下的一個區塊

想像成是一個發送與監聽機制，分別是`emit`與`on`

例如使用者點擊按鈕後會`emit`一個事件名稱，而和`on`綁定的相同事件名之函式則會接收到此事件
