Skip to content

Commit b14d9c5

Browse files
a0viedorvagg
authored andcommitted
doc: add method links in events.markdown
Added referenced method links. PR-URL: #3187 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 44f779b commit b14d9c5

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

doc/api/events.markdown

+10-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
<!--type=module-->
66

7-
Many objects in Node.js emit events: a `net.Server` emits an event each time
8-
a peer connects to it, a `fs.readStream` emits an event when the file is
7+
Many objects in Node.js emit events: a
8+
[`net.Server`](net.html#net_class_net_server) emits an event each time a peer
9+
connects to it, a [`fs.ReadStream`](fs.html#fs_class_fs_readstream) emits an
10+
event when the file is
911
opened. All objects which emit events are instances of `events.EventEmitter`.
1012
You can access this module by doing: `require("events");`
1113

@@ -99,7 +101,8 @@ Returns emitter, so calls can be chained.
99101
### emitter.getMaxListeners()
100102

101103
Returns the current max listener value for the emitter which is either set by
102-
`emitter.setMaxListeners(n)` or defaults to `EventEmitter.defaultMaxListeners`.
104+
[`emitter.setMaxListeners(n)`](#events_emitter_setmaxlisteners_n) or defaults to
105+
[`EventEmitter.defaultMaxListeners`](#events_eventemitter_defaultmaxlisteners).
103106

104107
This can be useful to increment/decrement max listeners to avoid the warning
105108
while not being irresponsible and setting a too big number.
@@ -112,12 +115,13 @@ while not being irresponsible and setting a too big number.
112115

113116
### EventEmitter.defaultMaxListeners
114117

115-
`emitter.setMaxListeners(n)` sets the maximum on a per-instance basis.
118+
[`emitter.setMaxListeners(n)`](#events_emitter_setmaxlisteners_n) sets the
119+
maximum on a per-instance basis.
116120
This class property lets you set it for *all* `EventEmitter` instances,
117121
current and future, effective immediately. Use with care.
118122

119-
Note that `emitter.setMaxListeners(n)` still has precedence over
120-
`EventEmitter.defaultMaxListeners`.
123+
Note that [`emitter.setMaxListeners(n)`](#events_emitter_setmaxlisteners_n)
124+
still has precedence over `EventEmitter.defaultMaxListeners`.
121125

122126

123127
### emitter.listeners(event)

0 commit comments

Comments
 (0)