Skip to content

Commit 6e869be

Browse files
committed
doc: unify more headings
PR-URL: nodejs#20046 Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent f7fbbee commit 6e869be

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

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 @@ It is possible to have type name collisions. Embedders are encouraged to use
250250
unique prefixes, such as the npm package name, to prevent collisions when
251251
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 @@ will run *after* the `'uncaughtException'` event is emitted or a `domain`'s
425425
handler runs.
426426

427427

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

430430
* `asyncId` {number}
431431

@@ -437,7 +437,7 @@ made to the `resource` object passed to `init` it is possible that `destroy`
437437
will never be called, causing a memory leak in the application. If the resource
438438
does not depend on garbage collection, then this will not be an issue.
439439

440-
##### `promiseResolve(asyncId)`
440+
##### promiseResolve(asyncId)
441441

442442
* `asyncId` {number}
443443

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

467-
#### `async_hooks.executionAsyncId()`
467+
#### async_hooks.executionAsyncId()
468468

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

509-
#### `async_hooks.triggerAsyncId()`
509+
#### async_hooks.triggerAsyncId()
510510

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

586-
### `class AsyncResource()`
586+
### Class: AsyncResource
587587

588588
The class `AsyncResource` is designed to be extended by the embedder's async
589589
resources. Using this, users can easily trigger the lifetime events of their
@@ -629,7 +629,7 @@ asyncResource.emitBefore();
629629
asyncResource.emitAfter();
630630
```
631631

632-
#### `AsyncResource(type[, options])`
632+
#### new AsyncResource(type[, options])
633633

634634
* `type` {string} The type of async event.
635635
* `options` {Object}
@@ -662,7 +662,7 @@ class DBQuery extends AsyncResource {
662662
}
663663
```
664664

665-
#### `asyncResource.runInAsyncScope(fn[, thisArg, ...args])`
665+
#### asyncResource.runInAsyncScope(fn[, thisArg, ...args])
666666
<!-- YAML
667667
added: v9.6.0
668668
-->
@@ -677,7 +677,7 @@ of the async resource. This will establish the context, trigger the AsyncHooks
677677
before callbacks, call the function, trigger the AsyncHooks after callbacks, and
678678
then restore the original execution context.
679679

680-
#### `asyncResource.emitBefore()`
680+
#### asyncResource.emitBefore()
681681
<!-- YAML
682682
deprecated: v9.6.0
683683
-->
@@ -693,7 +693,7 @@ will abort. For this reason, the `emitBefore` and `emitAfter` APIs are
693693
considered deprecated. Please use `runInAsyncScope`, as it provides a much safer
694694
alternative.
695695

696-
#### `asyncResource.emitAfter()`
696+
#### asyncResource.emitAfter()
697697
<!-- YAML
698698
deprecated: v9.6.0
699699
-->
@@ -712,18 +712,18 @@ will abort. For this reason, the `emitBefore` and `emitAfter` APIs are
712712
considered deprecated. Please use `runInAsyncScope`, as it provides a much safer
713713
alternative.
714714

715-
#### `asyncResource.emitDestroy()`
715+
#### asyncResource.emitDestroy()
716716

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

722-
#### `asyncResource.asyncId()`
722+
#### asyncResource.asyncId()
723723

724724
* Returns: {number} The unique `asyncId` assigned to the resource.
725725

726-
#### `asyncResource.triggerAsyncId()`
726+
#### asyncResource.triggerAsyncId()
727727

728728
* Returns: {number} The same `triggerAsyncId` that is passed to the
729729
`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
-->

doc/api/esm.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ Only the CLI argument for the main entry point to the program can be an entry
3737
point into an ESM graph. Dynamic import can also be used to create entry points
3838
into ESM graphs at runtime.
3939

40-
#### `import.meta`
40+
#### import.meta
41+
42+
* {Object}
4143

4244
The `import.meta` metaproperty is an `Object` that contains the following
4345
property:
44-
* `url` {string} The absolute `file:` URL of the module
46+
47+
* `url` {string} The absolute `file:` URL of the module.
4548

4649
### Unsupported
4750

0 commit comments

Comments
 (0)