Skip to content

Commit eeab4d5

Browse files
committed
Add node: for internal modules
1 parent c088b87 commit eeab4d5

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

JavaScript/1-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
3+
const threads = require('node:worker_threads');
44
const { Worker } = threads;
55

66
const getInheritance = (instance, parents = []) => {

JavaScript/2-master.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
3+
const threads = require('node:worker_threads');
44
const { Worker } = threads;
55

66
console.dir({ master: threads });

JavaScript/2-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
3+
const threads = require('node:worker_threads');
44

55
console.dir({ worker: threads });
66
threads.parentPort.postMessage('Message from Worker to Master');

JavaScript/3-http.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
4-
const http = require('http');
3+
const threads = require('node:worker_threads');
4+
const http = require('node:http');
55

66
const port = 8000;
77

JavaScript/3-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
3+
const threads = require('node:worker_threads');
44
const { Worker } = threads;
55

66
const worker = new Worker('./3-http.js');

JavaScript/4-access.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
3+
const threads = require('node:worker_threads');
44

55
const { buffer } = threads.workerData;
66
const array = new Int8Array(buffer);

JavaScript/4-share.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
3+
const threads = require('node:worker_threads');
44
const { Worker } = threads;
55

66
const buffer = new SharedArrayBuffer(1024);

JavaScript/5-access.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
3+
const threads = require('node:worker_threads');
44

55
const { buffer } = threads.workerData;
66
const array = new Int8Array(buffer);

JavaScript/5-share.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const threads = require('worker_threads');
3+
const threads = require('node:worker_threads');
44
const { Worker } = threads;
55

66
const buffer = new SharedArrayBuffer(1024);

0 commit comments

Comments
 (0)