File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -164,15 +164,15 @@ will be run synchronously whenever a message is published to the channel. Any
164164errors 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
169169diagnostics_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
177177diagnostics_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
199199function 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
211211function onMessage (message , name ) {
212212 // Received data
Original file line number Diff line number Diff 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
927927const {
928928 isBuildingSnapshot ,
929929 addSerializeCallback ,
930930 addDeserializeCallback ,
931931 setDeserializeMainFunction
932- } = require (' v8' ).startupSnapshot ;
932+ } = require (' node: v8' ).startupSnapshot ;
933933
934934const filePath = path .resolve (__dirname , ' ../x1024.txt' );
935935const storage = {};
Original file line number Diff line number Diff line change @@ -1476,8 +1476,8 @@ console.log(`from readable: ${data.byteLength}`);
14761476
14771477` ` ` cjs
14781478const { 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
14821482const encoder = new TextEncoder ();
14831483const dataArray = encoder .encode ([' hello world from consumers!' ]);
You can’t perform that action at this time.
0 commit comments