GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: add emit to NodeEventTarget · nodejs/node@45fccc9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • events.md
  • lib/internal
    • event_target.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/events.md‎

Copy file name to clipboardExpand all lines: doc/api/events.md
+16-2Lines changed: 16 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2314,6 +2314,20 @@ equivalent `EventEmitter` API. The only difference between `addListener()` and
23142314
`addEventListener()` is that `addListener()` will return a reference to the
23152315
`EventTarget`.
23162316

2317+
#### `nodeEventTarget.emit(type, arg)`
2318+
2319+
<!-- YAML
2320+
added: v15.2.0
2321+
-->
2322+
2323+
* `type` {string}
2324+
* `arg` {any}
2325+
* Returns: {boolean} `true` if event listeners registered for the `type` exist,
2326+
otherwise `false`.
2327+
2328+
Node.js-specific extension to the `EventTarget` class that dispatches the
2329+
`arg` to the list of handlers for `type`.
2330+
23172331
#### `nodeEventTarget.eventNames()`
23182332

23192333
<!-- YAML
@@ -2375,7 +2389,7 @@ added: v14.5.0
23752389

23762390
* Returns: {EventTarget} this
23772391

2378-
Node.js-specific alias for `eventTarget.removeListener()`.
2392+
Node.js-specific alias for `eventTarget.removeEventListener()`.
23792393

23802394
#### `nodeEventTarget.on(type, listener)`
23812395

@@ -2389,7 +2403,7 @@ added: v14.5.0
23892403

23902404
* Returns: {EventTarget} this
23912405

2392-
Node.js-specific alias for `eventTarget.addListener()`.
2406+
Node.js-specific alias for `eventTarget.addEventListener()`.
23932407

23942408
#### `nodeEventTarget.once(type, listener)`
23952409

Collapse file

‎lib/internal/event_target.js‎

Copy file name to clipboardExpand all lines: lib/internal/event_target.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ class NodeEventTarget extends EventTarget {
916916
}
917917

918918
/**
919-
* @param {string} type
919+
* @param {string} [type]
920920
* @returns {NodeEventTarget}
921921
*/
922922
removeAllListeners(type) {

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.