nodeEventTarget.emit(type, arg)


  • type <string>
  • arg <any>
  • 返回值: <boolean> 如果已为 type 注册了事件监听器则返回 true,否则返回 false

Node.js 特定的 EventTarget 类扩展,会将 arg 分发到 type 的处理程序列表中。

【Node.js-specific extension to the EventTarget class that dispatches the arg to the list of handlers for type.】