Skip to content

Commit efff5dc

Browse files
vsemozhetbytBridgeAR
authored andcommitted
doc: unify more headings
PR-URL: nodejs#20046 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 55cd91c commit efff5dc

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

doc/api/async_hooks.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function destroy(asyncId) { }
7575
function promiseResolve(asyncId) { }
7676
```
7777

78-
#### `async_hooks.createHook(callbacks)`
78+
#### async_hooks.createHook(callbacks)
7979

8080
<!-- YAML
8181
added: v8.1.0
@@ -168,7 +168,7 @@ provided by AsyncHooks itself. The logging should then be skipped when
168168
it was the logging itself that caused AsyncHooks callback to call. By
169169
doing this the otherwise infinite recursion is broken.
170170

171-
#### `asyncHook.enable()`
171+
#### asyncHook.enable()
172172

173173
* Returns: {AsyncHook} A reference to `asyncHook`.
174174

@@ -184,7 +184,7 @@ const async_hooks = require('async_hooks');
184184
const hook = async_hooks.createHook(callbacks).enable();
185185
```
186186

187-
#### `asyncHook.disable()`
187+
#### asyncHook.disable()
188188

189189
* Returns: {AsyncHook} A reference to `asyncHook`.
190190

@@ -200,7 +200,7 @@ Key events in the lifetime of asynchronous events have been categorized into
200200
four areas: instantiation, before/after the callback is called, and when the
201201
instance is destroyed.
202202

203-
##### `init(asyncId, type, triggerAsyncId, resource)`
203+
##### init(asyncId, type, triggerAsyncId, resource)
204204

205205
* `asyncId` {number} A unique ID for the async resource.
206206
* `type` {string} The type of the async resource.
@@ -250,7 +250,7 @@ Users are able to define their own `type` when using the public embedder API.
250250
to use unique prefixes, such as the npm package name, to prevent collisions
251251
when listening to the hooks.
252252

253-
###### `triggerId`
253+
###### `triggerAsyncId`
254254

255255
`triggerAsyncId` is the `asyncId` of the resource that caused (or "triggered")
256256
the new resource to initialize and that caused `init` to call. This is different
@@ -396,7 +396,7 @@ The graph only shows *when* a resource was created, not *why*, so to track
396396
the *why* use `triggerAsyncId`.
397397

398398

399-
##### `before(asyncId)`
399+
##### before(asyncId)
400400

401401
* `asyncId` {number}
402402

@@ -414,7 +414,7 @@ callback multiple times, while other operations like `fs.open()` will call
414414
it only once.
415415

416416

417-
##### `after(asyncId)`
417+
##### after(asyncId)
418418

419419
* `asyncId` {number}
420420

@@ -425,7 +425,7 @@ Called immediately after the callback specified in `before` is completed.
425425
`domain`'s handler runs.
426426

427427

428-
##### `destroy(asyncId)`
428+
##### destroy(asyncId)
429429

430430
* `asyncId` {number}
431431

@@ -438,7 +438,7 @@ reference is made to the `resource` object passed to `init` it is possible that
438438
the resource does not depend on garbage collection, then this will not be an
439439
issue.
440440

441-
##### `promiseResolve(asyncId)`
441+
##### promiseResolve(asyncId)
442442

443443
* `asyncId` {number}
444444

@@ -466,7 +466,7 @@ init for PROMISE with id 6, trigger id: 5 # the Promise returned by then()
466466
after 6
467467
```
468468

469-
#### `async_hooks.executionAsyncId()`
469+
#### async_hooks.executionAsyncId()
470470

471471
<!-- YAML
472472
added: v8.1.0
@@ -508,7 +508,7 @@ const server = net.createServer(function onConnection(conn) {
508508
Note that promise contexts may not get precise executionAsyncIds by default.
509509
See the section on [promise execution tracking][].
510510

511-
#### `async_hooks.triggerAsyncId()`
511+
#### async_hooks.triggerAsyncId()
512512

513513
* Returns: {number} The ID of the resource responsible for calling the callback
514514
that is currently being executed.
@@ -585,7 +585,7 @@ Library developers that handle their own asynchronous resources performing tasks
585585
like I/O, connection pooling, or managing callback queues may use the
586586
`AsyncWrap` JavaScript API so that all the appropriate callbacks are called.
587587

588-
### `class AsyncResource()`
588+
### Class: AsyncResource
589589

590590
The class `AsyncResource` is designed to be extended by the embedder's async
591591
resources. Using this, users can easily trigger the lifetime events of their
@@ -631,7 +631,7 @@ asyncResource.emitBefore();
631631
asyncResource.emitAfter();
632632
```
633633

634-
#### `AsyncResource(type[, options])`
634+
#### new AsyncResource(type[, options])
635635

636636
* `type` {string} The type of async event.
637637
* `options` {Object}
@@ -664,7 +664,7 @@ class DBQuery extends AsyncResource {
664664
}
665665
```
666666

667-
#### `asyncResource.runInAsyncScope(fn[, thisArg, ...args])`
667+
#### asyncResource.runInAsyncScope(fn[, thisArg, ...args])
668668
<!-- YAML
669669
added: v9.6.0
670670
-->
@@ -679,7 +679,7 @@ of the async resource. This will establish the context, trigger the AsyncHooks
679679
before callbacks, call the function, trigger the AsyncHooks after callbacks, and
680680
then restore the original execution context.
681681

682-
#### `asyncResource.emitBefore()`
682+
#### asyncResource.emitBefore()
683683
<!-- YAML
684684
deprecated: v9.6.0
685685
-->
@@ -695,7 +695,7 @@ will abort. For this reason, the `emitBefore` and `emitAfter` APIs are
695695
considered deprecated. Please use `runInAsyncScope`, as it provides a much safer
696696
alternative.
697697

698-
#### `asyncResource.emitAfter()`
698+
#### asyncResource.emitAfter()
699699
<!-- YAML
700700
deprecated: v9.6.0
701701
-->
@@ -714,18 +714,18 @@ will abort. For this reason, the `emitBefore` and `emitAfter` APIs are
714714
considered deprecated. Please use `runInAsyncScope`, as it provides a much safer
715715
alternative.
716716

717-
#### `asyncResource.emitDestroy()`
717+
#### asyncResource.emitDestroy()
718718

719719
Call all `destroy` hooks. This should only ever be called once. An error will
720720
be thrown if it is called more than once. This **must** be manually called. If
721721
the resource is left to be collected by the GC then the `destroy` hooks will
722722
never be called.
723723

724-
#### `asyncResource.asyncId()`
724+
#### asyncResource.asyncId()
725725

726726
* Returns: {number} The unique `asyncId` assigned to the resource.
727727

728-
#### `asyncResource.triggerAsyncId()`
728+
#### asyncResource.triggerAsyncId()
729729

730730
* Returns: {number} The same `triggerAsyncId` that is passed to the
731731
`AsyncResource` constructor.

doc/api/dns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dns.resolve4('archive.org', (err, addresses) => {
5656
There are subtle consequences in choosing one over the other, please consult
5757
the [Implementation considerations section][] for more information.
5858

59-
## Class dns.Resolver
59+
## Class: dns.Resolver
6060
<!-- YAML
6161
added: v8.3.0
6262
-->

0 commit comments

Comments
 (0)