Skip to content

Commit 4d38bf2

Browse files
daeyeonRafaelGSS
authored andcommitted
doc: add node: prefix for examples
Core modules are currently distinguished with the `node:` prefix. This updates a few examples in docs to use the prefix for consistency. Signed-off-by: Daeyeon Jeong <[email protected]> PR-URL: #45328 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent bfe3819 commit 4d38bf2

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

doc/api/diagnostics_channel.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,15 @@ will be run synchronously whenever a message is published to the channel. Any
165165
errors thrown in the message handler will trigger an [`'uncaughtException'`][].
166166

167167
```mjs
168-
import diagnostics_channel from 'diagnostics_channel';
168+
import diagnostics_channel from 'node:diagnostics_channel';
169169

170170
diagnostics_channel.subscribe('my-channel', (message, name) => {
171171
// Received data
172172
});
173173
```
174174

175175
```cjs
176-
const diagnostics_channel = require('diagnostics_channel');
176+
const diagnostics_channel = require('node:diagnostics_channel');
177177

178178
diagnostics_channel.subscribe('my-channel', (message, name) => {
179179
// Received data
@@ -196,7 +196,7 @@ Remove a message handler previously registered to this channel with
196196
[`diagnostics_channel.subscribe(name, onMessage)`][].
197197

198198
```mjs
199-
import diagnostics_channel from 'diagnostics_channel';
199+
import diagnostics_channel from 'node:diagnostics_channel';
200200

201201
function onMessage(message, name) {
202202
// Received data
@@ -208,7 +208,7 @@ diagnostics_channel.unsubscribe('my-channel', onMessage);
208208
```
209209

210210
```cjs
211-
const diagnostics_channel = require('diagnostics_channel');
211+
const diagnostics_channel = require('node:diagnostics_channel');
212212

213213
function onMessage(message, name) {
214214
// Received data

doc/api/v8.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -923,17 +923,17 @@ contains the following script:
923923
```cjs
924924
'use strict';
925925

926-
const fs = require('fs');
927-
const zlib = require('zlib');
928-
const path = require('path');
929-
const assert = require('assert');
926+
const fs = require('node:fs');
927+
const zlib = require('node:zlib');
928+
const path = require('node:path');
929+
const assert = require('node:assert');
930930

931931
const {
932932
isBuildingSnapshot,
933933
addSerializeCallback,
934934
addDeserializeCallback,
935935
setDeserializeMainFunction
936-
} = require('v8').startupSnapshot;
936+
} = require('node:v8').startupSnapshot;
937937

938938
const filePath = path.resolve(__dirname, '../x1024.txt');
939939
const storage = {};

doc/api/webstreams.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1478,8 +1478,8 @@ console.log(`from readable: ${data.byteLength}`);
14781478
14791479
```cjs
14801480
const { arrayBuffer } = require('node:stream/consumers');
1481-
const { Readable } = require('stream');
1482-
const { TextEncoder } = require('util');
1481+
const { Readable } = require('node:stream');
1482+
const { TextEncoder } = require('node:util');
14831483

14841484
const encoder = new TextEncoder();
14851485
const dataArray = encoder.encode(['hello world from consumers!']);

0 commit comments

Comments
 (0)