Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4d38bf2

Browse filesBrowse 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 <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 bfe3819 commit 4d38bf2
Copy full SHA for 4d38bf2

File tree

Expand file treeCollapse file tree

3 files changed

+11
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+11
-11
lines changed
Open diff view settings
Collapse file

‎doc/api/diagnostics_channel.md‎

Copy file name to clipboardExpand all lines: doc/api/diagnostics_channel.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
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
Collapse file

‎doc/api/v8.md‎

Copy file name to clipboardExpand all lines: doc/api/v8.md
+5-5Lines changed: 5 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
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 = {};
Collapse file

‎doc/api/webstreams.md‎

Copy file name to clipboardExpand all lines: doc/api/webstreams.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.