Skip to content

Commit

Permalink
doc: add node: prefix for examples
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
daeyeon authored Nov 5, 2022
1 parent 28bf031 commit 11ffb7e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions doc/api/diagnostics_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ will be run synchronously whenever a message is published to the channel. Any
errors thrown in the message handler will trigger an [`'uncaughtException'`][].

```mjs
import diagnostics_channel from 'diagnostics_channel';
import diagnostics_channel from 'node:diagnostics_channel';

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

```cjs
const diagnostics_channel = require('diagnostics_channel');
const diagnostics_channel = require('node:diagnostics_channel');

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

```mjs
import diagnostics_channel from 'diagnostics_channel';
import diagnostics_channel from 'node:diagnostics_channel';

function onMessage(message, name) {
// Received data
Expand All @@ -216,7 +216,7 @@ diagnostics_channel.unsubscribe('my-channel', onMessage);
```

```cjs
const diagnostics_channel = require('diagnostics_channel');
const diagnostics_channel = require('node:diagnostics_channel');

function onMessage(message, name) {
// Received data
Expand Down
10 changes: 5 additions & 5 deletions doc/api/v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -923,17 +923,17 @@ contains the following script:
```cjs
'use strict';

const fs = require('fs');
const zlib = require('zlib');
const path = require('path');
const assert = require('assert');
const fs = require('node:fs');
const zlib = require('node:zlib');
const path = require('node:path');
const assert = require('node:assert');

const {
isBuildingSnapshot,
addSerializeCallback,
addDeserializeCallback,
setDeserializeMainFunction
} = require('v8').startupSnapshot;
} = require('node:v8').startupSnapshot;

const filePath = path.resolve(__dirname, '../x1024.txt');
const storage = {};
Expand Down
4 changes: 2 additions & 2 deletions doc/api/webstreams.md
Original file line number Diff line number Diff line change
Expand Up @@ -1478,8 +1478,8 @@ console.log(`from readable: ${data.byteLength}`);
```cjs
const { arrayBuffer } = require('node:stream/consumers');
const { Readable } = require('stream');
const { TextEncoder } = require('util');
const { Readable } = require('node:stream');
const { TextEncoder } = require('node:util');

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

0 comments on commit 11ffb7e

Please sign in to comment.