Skip to content

Commit a03e286

Browse files
committed
doc: fix single session to single context
1 parent bb2275c commit a03e286

1 file changed

Lines changed: 46 additions & 37 deletions

File tree

doc/api/globals.md

Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ These objects are available in all modules.
99
The following variables may appear to be global but are not. They exist only in
1010
the scope of [CommonJS modules][]:
1111

12-
* [`__dirname`][]
13-
* [`__filename`][]
14-
* [`exports`][]
15-
* [`module`][]
16-
* [`require()`][]
12+
- [`__dirname`][]
13+
- [`__filename`][]
14+
- [`exports`][]
15+
- [`module`][]
16+
- [`require()`][]
1717

1818
The objects listed here are specific to Node.js. There are [built-in objects][]
1919
that are part of the JavaScript language itself, which are also globally
@@ -39,12 +39,13 @@ The API is based on the Web API [`AbortController`][].
3939
```js
4040
const ac = new AbortController();
4141

42-
ac.signal.addEventListener('abort', () => console.log('Aborted!'),
43-
{ once: true });
42+
ac.signal.addEventListener('abort', () => console.log('Aborted!'), {
43+
once: true,
44+
});
4445

4546
ac.abort();
4647

47-
console.log(ac.signal.aborted); // Prints true
48+
console.log(ac.signal.aborted); // Prints true
4849
```
4950

5051
### `abortController.abort([reason])`
@@ -61,7 +62,7 @@ changes:
6162
description: Added the new optional reason argument.
6263
-->
6364

64-
* `reason` {any} An optional reason, retrievable on the `AbortSignal`'s
65+
- `reason` {any} An optional reason, retrievable on the `AbortSignal`'s
6566
`reason` property.
6667

6768
Triggers the abort signal, causing the `abortController.signal` to emit
@@ -75,7 +76,7 @@ added:
7576
- v14.17.0
7677
-->
7778

78-
* Type: {AbortSignal}
79+
- Type: {AbortSignal}
7980

8081
### Class: `AbortSignal`
8182

@@ -85,7 +86,7 @@ added:
8586
- v14.17.0
8687
-->
8788

88-
* Extends: {EventTarget}
89+
- Extends: {EventTarget}
8990

9091
The `AbortSignal` is used to notify observers when the
9192
`abortController.abort()` method is called.
@@ -104,8 +105,8 @@ changes:
104105
description: Added the new optional reason argument.
105106
-->
106107

107-
* `reason`: {any}
108-
* Returns: {AbortSignal}
108+
- `reason`: {any}
109+
- Returns: {AbortSignal}
109110

110111
Returns a new already aborted `AbortSignal`.
111112

@@ -117,7 +118,7 @@ added:
117118
- v16.14.0
118119
-->
119120

120-
* `delay` {number} The number of milliseconds to wait before triggering
121+
- `delay` {number} The number of milliseconds to wait before triggering
121122
the AbortSignal.
122123

123124
Returns a new `AbortSignal` which will be aborted in `delay` milliseconds.
@@ -130,7 +131,7 @@ added:
130131
- v18.17.0
131132
-->
132133

133-
* `signals` {AbortSignal\[]} The `AbortSignal`s of which to compose a new `AbortSignal`.
134+
- `signals` {AbortSignal\[]} The `AbortSignal`s of which to compose a new `AbortSignal`.
134135

135136
Returns a new `AbortSignal` which will be aborted if any of the provided
136137
signals are aborted. Its [`abortSignal.reason`][] will be set to whichever
@@ -155,9 +156,13 @@ const ac = new AbortController();
155156
ac.signal.onabort = () => console.log('aborted!');
156157

157158
// Or the EventTarget API...
158-
ac.signal.addEventListener('abort', (event) => {
159-
console.log(event.type); // Prints 'abort'
160-
}, { once: true });
159+
ac.signal.addEventListener(
160+
'abort',
161+
(event) => {
162+
console.log(event.type); // Prints 'abort'
163+
},
164+
{ once: true }
165+
);
161166

162167
ac.abort();
163168
```
@@ -181,7 +186,7 @@ added:
181186
- v14.17.0
182187
-->
183188

184-
* Type: {boolean} True after the `AbortController` has been aborted.
189+
- Type: {boolean} True after the `AbortController` has been aborted.
185190

186191
#### `abortSignal.onabort`
187192

@@ -191,7 +196,7 @@ added:
191196
- v14.17.0
192197
-->
193198

194-
* Type: {Function}
199+
- Type: {Function}
195200

196201
An optional callback function that may be set by user code to be notified
197202
when the `abortController.abort()` function has been called.
@@ -204,14 +209,14 @@ added:
204209
- v16.14.0
205210
-->
206211

207-
* Type: {any}
212+
- Type: {any}
208213

209214
An optional reason specified when the `AbortSignal` was triggered.
210215

211216
```js
212217
const ac = new AbortController();
213218
ac.abort(new Error('boom!'));
214-
console.log(ac.signal.reason); // Error: boom!
219+
console.log(ac.signal.reason); // Error: boom!
215220
```
216221

217222
#### `abortSignal.throwIfAborted()`
@@ -242,7 +247,7 @@ added: v0.1.103
242247

243248
<!-- type=global -->
244249

245-
* {Function}
250+
- {Function}
246251

247252
Used to handle binary data. See the [buffer section][].
248253

@@ -353,7 +358,7 @@ added: v0.1.100
353358

354359
<!-- type=global -->
355360

356-
* {Object}
361+
- {Object}
357362

358363
Used to print to stdout and stderr. See the [`console`][] section.
359364

@@ -553,7 +558,7 @@ added: v0.1.27
553558

554559
> Stability: 3 - Legacy. Use [`globalThis`][] instead.
555560
556-
* {Object} The global namespace object.
561+
- {Object} The global namespace object.
557562

558563
In browsers, the top-level scope has traditionally been the global scope. This
559564
means that `var something` will define a new global variable, except within
@@ -660,13 +665,15 @@ A partial implementation of [`window.navigator`][].
660665
added: v21.0.0
661666
-->
662667

663-
* {number}
668+
- {number}
664669

665670
The `navigator.hardwareConcurrency` read-only property returns the number of
666671
logical processors available to the current Node.js instance.
667672

668673
```js
669-
console.log(`This process is running on ${navigator.hardwareConcurrency} logical processors`);
674+
console.log(
675+
`This process is running on ${navigator.hardwareConcurrency} logical processors`
676+
);
670677
```
671678

672679
### `navigator.language`
@@ -675,7 +682,7 @@ console.log(`This process is running on ${navigator.hardwareConcurrency} logical
675682
added: v21.2.0
676683
-->
677684

678-
* {string}
685+
- {string}
679686

680687
The `navigator.language` read-only property returns a string representing the
681688
preferred language of the Node.js instance. The language will be determined by
@@ -687,7 +694,9 @@ The value is representing the language version as defined in [RFC 5646][].
687694
The fallback value on builds without ICU is `'en-US'`.
688695

689696
```js
690-
console.log(`The preferred language of the Node.js instance has the tag '${navigator.language}'`);
697+
console.log(
698+
`The preferred language of the Node.js instance has the tag '${navigator.language}'`
699+
);
691700
```
692701

693702
### `navigator.languages`
@@ -696,7 +705,7 @@ console.log(`The preferred language of the Node.js instance has the tag '${navig
696705
added: v21.2.0
697706
-->
698707

699-
* {Array<string>}
708+
- {Array<string>}
700709

701710
The `navigator.languages` read-only property returns an array of strings
702711
representing the preferred languages of the Node.js instance.
@@ -716,7 +725,7 @@ console.log(`The preferred languages are '${navigator.languages}'`);
716725
added: v21.2.0
717726
-->
718727

719-
* {string}
728+
- {string}
720729

721730
The `navigator.platform` read-only property returns a string identifying the
722731
platform on which the Node.js instance is running.
@@ -731,7 +740,7 @@ console.log(`This process is running on ${navigator.platform}`);
731740
added: v21.1.0
732741
-->
733742

734-
* {string}
743+
- {string}
735744

736745
The `navigator.userAgent` read-only property returns user agent
737746
consisting of the runtime name and major version number.
@@ -818,7 +827,7 @@ added: v0.1.7
818827

819828
<!-- type=global -->
820829

821-
* {Object}
830+
- {Object}
822831

823832
The process object. See the [`process` object][] section.
824833

@@ -830,7 +839,7 @@ added: v11.0.0
830839

831840
<!-- type=global -->
832841

833-
* `callback` {Function} Function to be queued.
842+
- `callback` {Function} Function to be queued.
834843

835844
The `queueMicrotask()` method queues a microtask to invoke `callback`. If
836845
`callback` throws an exception, the [`process` object][] `'uncaughtException'`
@@ -979,7 +988,7 @@ memory, with a storage quota of 10 MB. `sessionStorage` data persists only withi
979988
the currently running process, and is not shared between workers.
980989
[`--experimental-webstorage`][] CLI flag. `sessionStorage` data is not stored per
981990
user or per request when used in the context of a server, it is specific to
982-
a single session.
991+
a single context.
983992

984993
## `setImmediate(callback[, ...args])`
985994

@@ -1148,7 +1157,7 @@ added: v8.0.0
11481157

11491158
<!-- type=global -->
11501159

1151-
* {Object}
1160+
- {Object}
11521161

11531162
The object that acts as the namespace for all W3C
11541163
[WebAssembly][webassembly-org] related functionality. See the
@@ -1279,4 +1288,4 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
12791288
[built-in objects]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
12801289
[timers]: timers.md
12811290
[webassembly-org]: https://webassembly.org
1282-
[webassembly-mdn]: https://developer.mozilla.org/en-US/docs/WebAssembly
1291+
[webassembly-mdn]: https://developer.mozilla.org/en-US/docs/WebAssembly

0 commit comments

Comments
 (0)