Skip to content

Commit 3f69d21

Browse files
daeyeondanielleadams
authored andcommittedJan 3, 2023
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 <daeyeon.dev@gmail.com> PR-URL: #45328 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent c9c958e commit 3f69d21

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
@@ -164,15 +164,15 @@ will be run synchronously whenever a message is published to the channel. Any
164164
errors thrown in the message handler will trigger an [`'uncaughtException'`][].
165165

166166
```mjs
167-
import diagnostics_channel from 'diagnostics_channel';
167+
import diagnostics_channel from 'node:diagnostics_channel';
168168

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

174174
```cjs
175-
const diagnostics_channel = require('diagnostics_channel');
175+
const diagnostics_channel = require('node:diagnostics_channel');
176176

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

196196
```mjs
197-
import diagnostics_channel from 'diagnostics_channel';
197+
import diagnostics_channel from 'node:diagnostics_channel';
198198

199199
function onMessage(message, name) {
200200
// Received data
@@ -206,7 +206,7 @@ diagnostics_channel.unsubscribe('my-channel', onMessage);
206206
```
207207

208208
```cjs
209-
const diagnostics_channel = require('diagnostics_channel');
209+
const diagnostics_channel = require('node:diagnostics_channel');
210210

211211
function onMessage(message, name) {
212212
// Received data

‎doc/api/v8.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -919,17 +919,17 @@ contains the following script:
919919
```cjs
920920
'use strict';
921921

922-
const fs = require('fs');
923-
const zlib = require('zlib');
924-
const path = require('path');
925-
const assert = require('assert');
922+
const fs = require('node:fs');
923+
const zlib = require('node:zlib');
924+
const path = require('node:path');
925+
const assert = require('node:assert');
926926

927927
const {
928928
isBuildingSnapshot,
929929
addSerializeCallback,
930930
addDeserializeCallback,
931931
setDeserializeMainFunction
932-
} = require('v8').startupSnapshot;
932+
} = require('node:v8').startupSnapshot;
933933

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

‎doc/api/webstreams.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1476,8 +1476,8 @@ console.log(`from readable: ${data.byteLength}`);
14761476
14771477
```cjs
14781478
const { arrayBuffer } = require('node:stream/consumers');
1479-
const { Readable } = require('stream');
1480-
const { TextEncoder } = require('util');
1479+
const { Readable } = require('node:stream');
1480+
const { TextEncoder } = require('node:util');
14811481

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

0 commit comments

Comments
 (0)
Please sign in to comment.