Skip to content

doc: add method links in events.markdown #3187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions doc/api/events.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

<!--type=module-->

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

Expand Down Expand Up @@ -99,7 +99,7 @@ Returns emitter, so calls can be chained.
### emitter.getMaxListeners()

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

This can be useful to increment/decrement max listeners to avoid the warning
while not being irresponsible and setting a too big number.
Expand All @@ -112,11 +112,11 @@ while not being irresponsible and setting a too big number.

### EventEmitter.defaultMaxListeners

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

Note that `emitter.setMaxListeners(n)` still has precedence over
Note that [`emitter.setMaxListeners(n)`](#events_emitter_setmaxlisteners_n) still has precedence over
`EventEmitter.defaultMaxListeners`.


Expand Down