diff options
Diffstat (limited to 'doc/api/process.md')
-rw-r--r-- | doc/api/process.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/api/process.md b/doc/api/process.md index 7c156e9492..a36cad6419 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -374,7 +374,7 @@ command-line option can be used to suppress the default console output but the The following example illustrates the warning that is printed to `stderr` when too many listeners have been added to an event: -```txt +```console $ node > events.defaultMaxListeners = 1; > process.on('foo', () => {}); @@ -386,7 +386,7 @@ detected. 2 foo listeners added. Use emitter.setMaxListeners() to increase limit In contrast, the following example turns off the default warning output and adds a custom handler to the `'warning'` event: -```txt +```console $ node --no-warnings > const p = process.on('warning', (warning) => console.warn('Do not do that!')); > events.defaultMaxListeners = 1; |