File tree 3 files changed +11
-11
lines changed
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -165,15 +165,15 @@ will be run synchronously whenever a message is published to the channel. Any
165
165
errors thrown in the message handler will trigger an [ ` 'uncaughtException' ` ] [ ] .
166
166
167
167
``` mjs
168
- import diagnostics_channel from ' diagnostics_channel' ;
168
+ import diagnostics_channel from ' node: diagnostics_channel' ;
169
169
170
170
diagnostics_channel .subscribe (' my-channel' , (message , name ) => {
171
171
// Received data
172
172
});
173
173
```
174
174
175
175
``` cjs
176
- const diagnostics_channel = require (' diagnostics_channel' );
176
+ const diagnostics_channel = require (' node: diagnostics_channel' );
177
177
178
178
diagnostics_channel .subscribe (' my-channel' , (message , name ) => {
179
179
// Received data
@@ -196,7 +196,7 @@ Remove a message handler previously registered to this channel with
196
196
[ ` diagnostics_channel.subscribe(name, onMessage) ` ] [ ] .
197
197
198
198
``` mjs
199
- import diagnostics_channel from ' diagnostics_channel' ;
199
+ import diagnostics_channel from ' node: diagnostics_channel' ;
200
200
201
201
function onMessage (message , name ) {
202
202
// Received data
@@ -208,7 +208,7 @@ diagnostics_channel.unsubscribe('my-channel', onMessage);
208
208
```
209
209
210
210
``` cjs
211
- const diagnostics_channel = require (' diagnostics_channel' );
211
+ const diagnostics_channel = require (' node: diagnostics_channel' );
212
212
213
213
function onMessage (message , name ) {
214
214
// Received data
Original file line number Diff line number Diff line change @@ -923,17 +923,17 @@ contains the following script:
923
923
``` cjs
924
924
' use strict' ;
925
925
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' );
930
930
931
931
const {
932
932
isBuildingSnapshot ,
933
933
addSerializeCallback ,
934
934
addDeserializeCallback ,
935
935
setDeserializeMainFunction
936
- } = require (' v8' ).startupSnapshot ;
936
+ } = require (' node: v8' ).startupSnapshot ;
937
937
938
938
const filePath = path .resolve (__dirname , ' ../x1024.txt' );
939
939
const storage = {};
Original file line number Diff line number Diff line change @@ -1478,8 +1478,8 @@ console.log(`from readable: ${data.byteLength}`);
1478
1478
1479
1479
` ` ` cjs
1480
1480
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' );
1483
1483
1484
1484
const encoder = new TextEncoder ();
1485
1485
const dataArray = encoder .encode ([' hello world from consumers!' ]);
You can’t perform that action at this time.
0 commit comments