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
164
164
errors thrown in the message handler will trigger an [ ` 'uncaughtException' ` ] [ ] .
165
165
166
166
``` mjs
167
- import diagnostics_channel from ' diagnostics_channel' ;
167
+ import diagnostics_channel from ' node: diagnostics_channel' ;
168
168
169
169
diagnostics_channel .subscribe (' my-channel' , (message , name ) => {
170
170
// Received data
171
171
});
172
172
```
173
173
174
174
``` cjs
175
- const diagnostics_channel = require (' diagnostics_channel' );
175
+ const diagnostics_channel = require (' node: diagnostics_channel' );
176
176
177
177
diagnostics_channel .subscribe (' my-channel' , (message , name ) => {
178
178
// Received data
@@ -194,7 +194,7 @@ Remove a message handler previously registered to this channel with
194
194
[ ` diagnostics_channel.subscribe(name, onMessage) ` ] [ ] .
195
195
196
196
``` mjs
197
- import diagnostics_channel from ' diagnostics_channel' ;
197
+ import diagnostics_channel from ' node: diagnostics_channel' ;
198
198
199
199
function onMessage (message , name ) {
200
200
// Received data
@@ -206,7 +206,7 @@ diagnostics_channel.unsubscribe('my-channel', onMessage);
206
206
```
207
207
208
208
``` cjs
209
- const diagnostics_channel = require (' diagnostics_channel' );
209
+ const diagnostics_channel = require (' node: diagnostics_channel' );
210
210
211
211
function onMessage (message , name ) {
212
212
// Received data
Original file line number Diff line number Diff line change @@ -919,17 +919,17 @@ contains the following script:
919
919
``` cjs
920
920
' use strict' ;
921
921
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' );
926
926
927
927
const {
928
928
isBuildingSnapshot ,
929
929
addSerializeCallback ,
930
930
addDeserializeCallback ,
931
931
setDeserializeMainFunction
932
- } = require (' v8' ).startupSnapshot ;
932
+ } = require (' node: v8' ).startupSnapshot ;
933
933
934
934
const filePath = path .resolve (__dirname , ' ../x1024.txt' );
935
935
const storage = {};
Original file line number Diff line number Diff line change @@ -1476,8 +1476,8 @@ console.log(`from readable: ${data.byteLength}`);
1476
1476
1477
1477
` ` ` cjs
1478
1478
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' );
1481
1481
1482
1482
const encoder = new TextEncoder ();
1483
1483
const dataArray = encoder .encode ([' hello world from consumers!' ]);
You can’t perform that action at this time.
0 commit comments