Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit a4160b8

Browse files
authored
chore: run sync-api for 18.9.0 docs (#2759)
1 parent d359fa3 commit a4160b8

62 files changed

Lines changed: 3779 additions & 3660 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content/api/v18/addons.en.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
title: 'addons'
33
displayTitle: 'C++ addons'
44
category: 'api'
5-
editPage: 'https://github.com/nodejs/node/blob/v18.8.0/doc/api/addons.md'
5+
editPage: 'https://github.com/nodejs/node/blob/v18.9.0/doc/api/addons.md'
66
version: 'v18'
77
---
88

9-
<Metadata version="v18.8.0" data={{"update":{"type":"introduced_in","version":["v0.10.0"]}}} />
9+
<Metadata version="v18.9.0" data={{"update":{"type":"introduced_in","version":["v0.10.0"]}}} />
1010

11-
<Metadata version="v18.8.0" data={{"type":"misc"}} />
11+
<Metadata version="v18.9.0" data={{"type":"misc"}} />
1212

1313
_Addons_ are dynamically-linked shared objects written in C++. The
1414
[`require()`][require] function can load addons as ordinary Node.js modules.
1515
Addons provide an interface between JavaScript and C/C++ libraries.
1616

1717
There are three options for implementing addons: Node-API, nan, or direct
18-
use of internal V8, libuv and Node.js libraries. Unless there is a need for
18+
use of internal V8, libuv, and Node.js libraries. Unless there is a need for
1919
direct access to functionality which is not exposed by Node-API, use Node-API.
2020
Refer to [C/C++ addons with Node-API](n-api.md) for more information on
2121
Node-API.
@@ -46,7 +46,7 @@ involving knowledge of several components and APIs:
4646

4747
* Node.js includes other statically linked libraries including OpenSSL. These
4848
other libraries are located in the `deps/` directory in the Node.js source
49-
tree. Only the libuv, OpenSSL, V8 and zlib symbols are purposefully
49+
tree. Only the libuv, OpenSSL, V8, and zlib symbols are purposefully
5050
re-exported by Node.js and may be used to various extents by addons. See
5151
[Linking to libraries included with Node.js][] for additional information.
5252

@@ -242,7 +242,7 @@ NODE_MODULE_INIT(/* exports, module, context */) {
242242

243243
##### Worker support
244244

245-
<Metadata version="v18.8.0" data={{"changes":[{"version":["v14.8.0","v12.19.0"],"pr-url":"https://github.com/nodejs/node/pull/34572","description":"Cleanup hooks may now be asynchronous."}]}} />
245+
<Metadata version="v18.9.0" data={{"changes":[{"version":["v14.8.0","v12.19.0"],"pr-url":"https://github.com/nodejs/node/pull/34572","description":"Cleanup hooks may now be asynchronous."}]}} />
246246

247247
In order to be loaded from multiple Node.js environments,
248248
such as a main thread and a Worker thread, an add-on needs to either:
@@ -392,7 +392,7 @@ try {
392392

393393
#### Linking to libraries included with Node.js
394394

395-
Node.js uses statically linked libraries such as V8, libuv and OpenSSL. All
395+
Node.js uses statically linked libraries such as V8, libuv, and OpenSSL. All
396396
addons are required to link to V8 and may link to any of the other dependencies
397397
as well. Typically, this is as simple as including the appropriate
398398
`#include <...>` statements (e.g. `#include <v8.h>`) and `node-gyp` will locate
@@ -441,7 +441,7 @@ illustration of how it can be used.
441441

442442
### Node-API
443443

444-
<Metadata version="v18.8.0" data={{"stability":{"level":2,"text":" - Stable"}}} />
444+
<Metadata version="v18.9.0" data={{"stability":{"level":2,"text":" - Stable"}}} />
445445

446446
Node-API is an API for building native addons. It is independent from
447447
the underlying JavaScript runtime (e.g. V8) and is maintained as part of

content/api/v18/assert.en.md

Lines changed: 68 additions & 52 deletions
Large diffs are not rendered by default.

content/api/v18/async_context.en.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
title: 'async_context'
33
displayTitle: 'Asynchronous context tracking'
44
category: 'api'
5-
editPage: 'https://github.com/nodejs/node/blob/v18.8.0/doc/api/async_context.md'
5+
editPage: 'https://github.com/nodejs/node/blob/v18.9.0/doc/api/async_context.md'
66
version: 'v18'
77
---
88

9-
<Metadata version="v18.8.0" data={{"update":{"type":"introduced_in","version":["v16.4.0"]}}} />
9+
<Metadata version="v18.9.0" data={{"update":{"type":"introduced_in","version":["v16.4.0"]}}} />
1010

11-
<Metadata version="v18.8.0" data={{"stability":{"level":2,"text":" - Stable"}}} />
11+
<Metadata version="v18.9.0" data={{"stability":{"level":2,"text":" - Stable"}}} />
1212

13-
<Metadata version="v18.8.0" data={{"source_link":"lib/async_hooks.js"}} />
13+
<Metadata version="v18.9.0" data={{"source_link":"lib/async_hooks.js"}} />
1414

1515
### Introduction
1616

@@ -33,7 +33,7 @@ const { AsyncLocalStorage, AsyncResource } = require('node:async_hooks');
3333

3434
### <DataTag tag="C" /> `AsyncLocalStorage`
3535

36-
<Metadata version="v18.8.0" data={{"changes":[{"version":"v16.4.0","pr-url":"https://github.com/nodejs/node/pull/37675","description":"AsyncLocalStorage is now Stable. Previously, it had been Experimental."}],"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
36+
<Metadata version="v18.9.0" data={{"changes":[{"version":"v16.4.0","pr-url":"https://github.com/nodejs/node/pull/37675","description":"AsyncLocalStorage is now Stable. Previously, it had been Experimental."}],"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
3737

3838
This class creates stores that stay coherent through asynchronous operations.
3939

@@ -116,16 +116,16 @@ with each other's data.
116116

117117
#### <DataTag tag="M" /> `new AsyncLocalStorage()`
118118

119-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
119+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
120120

121121
Creates a new instance of `AsyncLocalStorage`. Store is only provided within a
122122
`run()` call or after an `enterWith()` call.
123123

124124
#### <DataTag tag="M" /> `asyncLocalStorage.disable()`
125125

126-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
126+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
127127

128-
<Metadata version="v18.8.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
128+
<Metadata version="v18.9.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
129129

130130
Disables the instance of `AsyncLocalStorage`. All subsequent calls
131131
to `asyncLocalStorage.getStore()` will return `undefined` until
@@ -144,7 +144,7 @@ in the current process.
144144

145145
#### <DataTag tag="M" /> `asyncLocalStorage.getStore()`
146146

147-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
147+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
148148

149149
* Returns: [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)
150150

@@ -155,9 +155,9 @@ returns `undefined`.
155155

156156
#### <DataTag tag="M" /> `asyncLocalStorage.enterWith(store)`
157157

158-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.11.0","v12.17.0"]}}} />
158+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.11.0","v12.17.0"]}}} />
159159

160-
<Metadata version="v18.8.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
160+
<Metadata version="v18.9.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
161161

162162
* `store` [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)
163163

@@ -201,7 +201,7 @@ asyncLocalStorage.getStore(); // Returns the same object
201201

202202
#### <DataTag tag="M" /> `asyncLocalStorage.run(store, callback[, ...args])`
203203

204-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
204+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
205205

206206
* `store` [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)
207207
* `callback` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
@@ -237,9 +237,9 @@ try {
237237

238238
#### <DataTag tag="M" /> `asyncLocalStorage.exit(callback[, ...args])`
239239

240-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
240+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.10.0","v12.17.0"]}}} />
241241

242-
<Metadata version="v18.8.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
242+
<Metadata version="v18.9.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
243243

244244
* `callback` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
245245
* `...args` [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)
@@ -306,7 +306,7 @@ probably responsible for the context loss.
306306

307307
### <DataTag tag="C" /> `AsyncResource`
308308

309-
<Metadata version="v18.8.0" data={{"changes":[{"version":"v16.4.0","pr-url":"https://github.com/nodejs/node/pull/37675","description":"AsyncResource is now Stable. Previously, it had been Experimental."}]}} />
309+
<Metadata version="v18.9.0" data={{"changes":[{"version":"v16.4.0","pr-url":"https://github.com/nodejs/node/pull/37675","description":"AsyncResource is now Stable. Previously, it had been Experimental."}]}} />
310310

311311
The class `AsyncResource` is designed to be extended by the embedder's async
312312
resources. Using this, users can easily trigger the lifetime events of their
@@ -410,7 +410,7 @@ class DBQuery extends AsyncResource {
410410

411411
#### Static method: `AsyncResource.bind(fn[, type[, thisArg]])`
412412

413-
<Metadata version="v18.8.0" data={{"changes":[{"version":"v17.8.0","pr-url":"https://github.com/nodejs/node/pull/42177","description":"Changed the default when `thisArg` is undefined to use `this` from the caller."},{"version":"v16.0.0","pr-url":"https://github.com/nodejs/node/pull/36782","description":"Added optional thisArg."}],"update":{"type":"added","version":["v14.8.0","v12.19.0"]}}} />
413+
<Metadata version="v18.9.0" data={{"changes":[{"version":"v17.8.0","pr-url":"https://github.com/nodejs/node/pull/42177","description":"Changed the default when `thisArg` is undefined to use `this` from the caller."},{"version":"v16.0.0","pr-url":"https://github.com/nodejs/node/pull/36782","description":"Added optional thisArg."}],"update":{"type":"added","version":["v14.8.0","v12.19.0"]}}} />
414414

415415
* `fn` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) The function to bind to the current execution context.
416416
* `type` [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) An optional name to associate with the underlying
@@ -424,7 +424,7 @@ the `AsyncResource` to which the function is bound.
424424

425425
#### <DataTag tag="M" /> `asyncResource.bind(fn[, thisArg])`
426426

427-
<Metadata version="v18.8.0" data={{"changes":[{"version":"v17.8.0","pr-url":"https://github.com/nodejs/node/pull/42177","description":"Changed the default when `thisArg` is undefined to use `this` from the caller."},{"version":"v16.0.0","pr-url":"https://github.com/nodejs/node/pull/36782","description":"Added optional thisArg."}],"update":{"type":"added","version":["v14.8.0","v12.19.0"]}}} />
427+
<Metadata version="v18.9.0" data={{"changes":[{"version":"v17.8.0","pr-url":"https://github.com/nodejs/node/pull/42177","description":"Changed the default when `thisArg` is undefined to use `this` from the caller."},{"version":"v16.0.0","pr-url":"https://github.com/nodejs/node/pull/36782","description":"Added optional thisArg."}],"update":{"type":"added","version":["v14.8.0","v12.19.0"]}}} />
428428

429429
* `fn` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) The function to bind to the current `AsyncResource`.
430430
* `thisArg` [`any`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Data_types)
@@ -436,7 +436,7 @@ the `AsyncResource` to which the function is bound.
436436

437437
#### <DataTag tag="M" /> `asyncResource.runInAsyncScope(fn[, thisArg, ...args])`
438438

439-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v9.6.0"]}}} />
439+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v9.6.0"]}}} />
440440

441441
* `fn` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) The function to call in the execution context of this async
442442
resource.

content/api/v18/async_hooks.en.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
title: 'async_hooks'
33
displayTitle: 'Async hooks'
44
category: 'api'
5-
editPage: 'https://github.com/nodejs/node/blob/v18.8.0/doc/api/async_hooks.md'
5+
editPage: 'https://github.com/nodejs/node/blob/v18.9.0/doc/api/async_hooks.md'
66
version: 'v18'
77
---
88

9-
<Metadata version="v18.8.0" data={{"update":{"type":"introduced_in","version":["v8.1.0"]}}} />
9+
<Metadata version="v18.9.0" data={{"update":{"type":"introduced_in","version":["v8.1.0"]}}} />
1010

11-
<Metadata version="v18.8.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
11+
<Metadata version="v18.9.0" data={{"stability":{"level":1,"text":" - Experimental"}}} />
1212

13-
<Metadata version="v18.8.0" data={{"source_link":"lib/async_hooks.js"}} />
13+
<Metadata version="v18.9.0" data={{"source_link":"lib/async_hooks.js"}} />
1414

1515
The `node:async_hooks` module provides an API to track asynchronous resources.
1616
It can be accessed using:
@@ -137,7 +137,7 @@ function promiseResolve(asyncId) { }
137137

138138
### <DataTag tag="M" /> `async_hooks.createHook(callbacks)`
139139

140-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v8.1.0"]}}} />
140+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v8.1.0"]}}} />
141141

142142
* `callbacks` [`Object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) The [Hook Callbacks][] to register
143143
* `init` [`Function`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) The [`init` callback][].
@@ -574,7 +574,7 @@ does not depend on garbage collection, then this will not be an issue.
574574

575575
##### <DataTag tag="M" /> `promiseResolve(asyncId)`
576576

577-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v8.6.0"]}}} />
577+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v8.6.0"]}}} />
578578

579579
* `asyncId` [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type)
580580

@@ -603,7 +603,7 @@ init for PROMISE with id 6, trigger id: 5 # the Promise returned by then()
603603

604604
#### <DataTag tag="M" /> `async_hooks.executionAsyncResource()`
605605

606-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v13.9.0","v12.17.0"]}}} />
606+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v13.9.0","v12.17.0"]}}} />
607607

608608
* Returns: [`Object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) The resource representing the current execution.
609609
Useful to store data within the resource.
@@ -693,7 +693,7 @@ const server = createServer((req, res) => {
693693
694694
#### <DataTag tag="M" /> `async_hooks.executionAsyncId()`
695695
696-
<Metadata version="v18.8.0" data={{"changes":[{"version":"v8.2.0","pr-url":"https://github.com/nodejs/node/pull/13490","description":"Renamed from `currentId`."}],"update":{"type":"added","version":["v8.1.0"]}}} />
696+
<Metadata version="v18.9.0" data={{"changes":[{"version":"v8.2.0","pr-url":"https://github.com/nodejs/node/pull/13490","description":"Renamed from `currentId`."}],"update":{"type":"added","version":["v8.1.0"]}}} />
697697
698698
* Returns: [`number`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) The `asyncId` of the current execution context. Useful to
699699
track when something calls.
@@ -760,7 +760,7 @@ the section on [promise execution tracking][].
760760
761761
#### <DataTag tag="M" /> `async_hooks.asyncWrapProviders`
762762
763-
<Metadata version="v18.8.0" data={{"update":{"type":"added","version":["v17.2.0","v16.14.0"]}}} />
763+
<Metadata version="v18.9.0" data={{"update":{"type":"added","version":["v17.2.0","v16.14.0"]}}} />
764764
765765
* Returns: A map of provider types to the corresponding numeric id.
766766
This map contains all the event types that might be emitted by the `async_hooks.init()` event.

0 commit comments

Comments
 (0)