| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4419,7 +4419,7 @@ An error occurred trying to allocate memory. This should never happen. | |||
| 4419 | 4419 | [`new URLSearchParams(iterable)`]: url.md#new-urlsearchparamsiterable | |
| 4420 | 4420 | [`package.json`]: packages.md#nodejs-packagejson-field-definitions | |
| 4421 | 4421 | [`postMessage()`]: worker_threads.md#portpostmessagevalue-transferlist | |
| 4422 | - [`postMessageToThread()`]: worker_threads.md#workerpostmessagetothreadthreadid-value-transferlist-timeout | ||
| 4422 | + [`postMessageToThread()`]: worker_threads.md#worker_threadspostmessagetothreadthreadid-value-transferlist-timeout | ||
| 4423 | 4423 | [`process.on('exit')`]: process.md#event-exit | |
| 4424 | 4424 | [`process.send()`]: process.md#processsendmessage-sendhandle-options-callback | |
| 4425 | 4425 | [`process.setUncaughtExceptionCaptureCallback()`]: process.md#processsetuncaughtexceptioncapturecallbackfn | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -831,7 +831,7 @@ navigator.locks.request('shared_resource', { mode: 'shared' }, async (lock) => { | |||
| 831 | 831 | }); | |
| 832 | 832 | ``` | |
| 833 | 833 | ||
| 834 | - See [`worker.locks`][] for detailed API documentation. | ||
| 834 | + See [`worker_threads.locks`][] for detailed API documentation. | ||
| 835 | 835 | ||
| 836 | 836 | ## Class: `PerformanceEntry` | |
| 837 | 837 | ||
@@ -1380,7 +1380,7 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. | |||
| 1380 | 1380 | [`setTimeout`]: timers.md#settimeoutcallback-delay-args | |
| 1381 | 1381 | [`structuredClone`]: https://developer.mozilla.org/en-US/docs/Web/API/structuredClone | |
| 1382 | 1382 | [`window.navigator`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator | |
| 1383 | - [`worker.locks`]: worker_threads.md#workerlocks | ||
| 1383 | + [`worker_threads.locks`]: worker_threads.md#worker_threadslocks | ||
| 1384 | 1384 | [browser `LockManager`]: https://developer.mozilla.org/en-US/docs/Web/API/LockManager | |
| 1385 | 1385 | [buffer section]: buffer.md | |
| 1386 | 1386 | [built-in objects]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4536,7 +4536,7 @@ cases: | |||
| 4536 | 4536 | [`net.Server`]: net.md#class-netserver | |
| 4537 | 4537 | [`net.Socket`]: net.md#class-netsocket | |
| 4538 | 4538 | [`os.constants.dlopen`]: os.md#dlopen-constants | |
| 4539 | - [`postMessageToThread()`]: worker_threads.md#workerpostmessagetothreadthreadid-value-transferlist-timeout | ||
| 4539 | + [`postMessageToThread()`]: worker_threads.md#worker_threadspostmessagetothreadthreadid-value-transferlist-timeout | ||
| 4540 | 4540 | [`process.argv`]: #processargv | |
| 4541 | 4541 | [`process.config`]: #processconfig | |
| 4542 | 4542 | [`process.execPath`]: #processexecpath | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,13 +10,13 @@ The `node:worker_threads` module enables the use of threads that execute | |||
| 10 | 10 | JavaScript in parallel. To access it: | |
| 11 | 11 | ||
| 12 | 12 | ```mjs | |
| 13 | - import worker from 'node:worker_threads'; | ||
| 13 | + import worker_threads from 'node:worker_threads'; | ||
| 14 | 14 | ``` | |
| 15 | 15 | ||
| 16 | 16 | ```cjs | |
| 17 | 17 | 'use strict'; | |
| 18 | 18 | ||
| 19 | - const worker = require('node:worker_threads'); | ||
| 19 | + const worker_threads = require('node:worker_threads'); | ||
| 20 | 20 | ``` | |
| 21 | 21 | ||
| 22 | 22 | Workers (threads) are useful for performing CPU-intensive JavaScript operations. | |
@@ -101,7 +101,7 @@ Worker threads inherit non-process-specific options by default. Refer to | |||
| 101 | 101 | [`Worker constructor options`][] to know how to customize worker thread options, | |
| 102 | 102 | specifically `argv` and `execArgv` options. | |
| 103 | 103 | ||
| 104 | - ## `worker.getEnvironmentData(key)` | ||
| 104 | + ## `worker_threads.getEnvironmentData(key)` | ||
| 105 | 105 | ||
| 106 | 106 | <!-- YAML | |
| 107 | 107 | added: | |
@@ -158,7 +158,7 @@ if (isMainThread) { | |||
| 158 | 158 | } | |
| 159 | 159 | ``` | |
| 160 | 160 | ||
| 161 | - ## `worker.isInternalThread` | ||
| 161 | + ## `worker_threads.isInternalThread` | ||
| 162 | 162 | ||
| 163 | 163 | <!-- YAML | |
| 164 | 164 | added: | |
@@ -202,7 +202,7 @@ const { isInternalThread } = require('node:worker_threads'); | |||
| 202 | 202 | console.log(isInternalThread); // false | |
| 203 | 203 | ``` | |
| 204 | 204 | ||
| 205 | - ## `worker.isMainThread` | ||
| 205 | + ## `worker_threads.isMainThread` | ||
| 206 | 206 | ||
| 207 | 207 | <!-- YAML | |
| 208 | 208 | added: v10.5.0 | |
@@ -238,7 +238,7 @@ if (isMainThread) { | |||
| 238 | 238 | } | |
| 239 | 239 | ``` | |
| 240 | 240 | ||
| 241 | - ## `worker.markAsUntransferable(object)` | ||
| 241 | + ## `worker_threads.markAsUntransferable(object)` | ||
| 242 | 242 | ||
| 243 | 243 | <!-- YAML | |
| 244 | 244 | added: | |
@@ -315,7 +315,7 @@ console.log(typedArray2); | |||
| 315 | 315 | ||
| 316 | 316 | There is no equivalent to this API in browsers. | |
| 317 | 317 | ||
| 318 | - ## `worker.isMarkedAsUntransferable(object)` | ||
| 318 | + ## `worker_threads.isMarkedAsUntransferable(object)` | ||
| 319 | 319 | ||
| 320 | 320 | <!-- YAML | |
| 321 | 321 | added: v21.0.0 | |
@@ -349,7 +349,7 @@ isMarkedAsUntransferable(pooledBuffer); // Returns true. | |||
| 349 | 349 | ||
| 350 | 350 | There is no equivalent to this API in browsers. | |
| 351 | 351 | ||
| 352 | - ## `worker.markAsUncloneable(object)` | ||
| 352 | + ## `worker_threads.markAsUncloneable(object)` | ||
| 353 | 353 | ||
| 354 | 354 | <!-- YAML | |
| 355 | 355 | added: | |
@@ -399,7 +399,7 @@ try { | |||
| 399 | 399 | ||
| 400 | 400 | There is no equivalent to this API in browsers. | |
| 401 | 401 | ||
| 402 | - ## `worker.moveMessagePortToContext(port, contextifiedSandbox)` | ||
| 402 | + ## `worker_threads.moveMessagePortToContext(port, contextifiedSandbox)` | ||
| 403 | 403 | ||
| 404 | 404 | <!-- YAML | |
| 405 | 405 | added: v11.13.0 | |
@@ -425,7 +425,7 @@ However, the created `MessagePort` no longer inherits from | |||
| 425 | 425 | {EventTarget}, and only [`port.onmessage()`][] can be used to receive | |
| 426 | 426 | events using it. | |
| 427 | 427 | ||
| 428 | - ## `worker.parentPort` | ||
| 428 | + ## `worker_threads.parentPort` | ||
| 429 | 429 | ||
| 430 | 430 | <!-- YAML | |
| 431 | 431 | added: v10.5.0 | |
@@ -476,7 +476,7 @@ if (isMainThread) { | |||
| 476 | 476 | } | |
| 477 | 477 | ``` | |
| 478 | 478 | ||
| 479 | - ## `worker.postMessageToThread(threadId, value[, transferList][, timeout])` | ||
| 479 | + ## `worker_threads.postMessageToThread(threadId, value[, transferList][, timeout])` | ||
| 480 | 480 | ||
| 481 | 481 | <!-- YAML | |
| 482 | 482 | added: | |
@@ -588,7 +588,7 @@ if (level === 0) { | |||
| 588 | 588 | channel.onmessage = channel.close; | |
| 589 | 589 | ``` | |
| 590 | 590 | ||
| 591 | - ## `worker.receiveMessageOnPort(port)` | ||
| 591 | + ## `worker_threads.receiveMessageOnPort(port)` | ||
| 592 | 592 | ||
| 593 | 593 | <!-- YAML | |
| 594 | 594 | added: v12.3.0 | |
@@ -634,7 +634,7 @@ console.log(receiveMessageOnPort(port2)); | |||
| 634 | 634 | When this function is used, no `'message'` event is emitted and the | |
| 635 | 635 | `onmessage` listener is not invoked. | |
| 636 | 636 | ||
| 637 | - ## `worker.resourceLimits` | ||
| 637 | + ## `worker_threads.resourceLimits` | ||
| 638 | 638 | ||
| 639 | 639 | <!-- YAML | |
| 640 | 640 | added: | |
@@ -654,7 +654,7 @@ this matches its values. | |||
| 654 | 654 | ||
| 655 | 655 | If this is used in the main thread, its value is an empty object. | |
| 656 | 656 | ||
| 657 | - ## `worker.SHARE_ENV` | ||
| 657 | + ## `worker_threads.SHARE_ENV` | ||
| 658 | 658 | ||
| 659 | 659 | <!-- YAML | |
| 660 | 660 | added: v11.14.0 | |
@@ -685,7 +685,7 @@ new Worker('process.env.SET_IN_WORKER = "foo"', { eval: true, env: SHARE_ENV }) | |||
| 685 | 685 | }); | |
| 686 | 686 | ``` | |
| 687 | 687 | ||
| 688 | - ## `worker.setEnvironmentData(key[, value])` | ||
| 688 | + ## `worker_threads.setEnvironmentData(key[, value])` | ||
| 689 | 689 | ||
| 690 | 690 | <!-- YAML | |
| 691 | 691 | added: | |
@@ -709,7 +709,7 @@ The `worker.setEnvironmentData()` API sets the content of | |||
| 709 | 709 | `worker.getEnvironmentData()` in the current thread and all new `Worker` | |
| 710 | 710 | instances spawned from the current context. | |
| 711 | 711 | ||
| 712 | - ## `worker.threadId` | ||
| 712 | + ## `worker_threads.threadId` | ||
| 713 | 713 | ||
| 714 | 714 | <!-- YAML | |
| 715 | 715 | added: v10.5.0 | |
@@ -721,7 +721,7 @@ An integer identifier for the current thread. On the corresponding worker object | |||
| 721 | 721 | (if there is any), it is available as [`worker.threadId`][]. | |
| 722 | 722 | This value is unique for each [`Worker`][] instance inside a single process. | |
| 723 | 723 | ||
| 724 | - ## `worker.threadName` | ||
| 724 | + ## `worker_threads.threadName` | ||
| 725 | 725 | ||
| 726 | 726 | <!-- YAML | |
| 727 | 727 | added: | |
@@ -734,7 +734,7 @@ added: | |||
| 734 | 734 | A string identifier for the current thread or null if the thread is not running. | |
| 735 | 735 | On the corresponding worker object (if there is any), it is available as [`worker.threadName`][]. | |
| 736 | 736 | ||
| 737 | - ## `worker.workerData` | ||
| 737 | + ## `worker_threads.workerData` | ||
| 738 | 738 | ||
| 739 | 739 | <!-- YAML | |
| 740 | 740 | added: v10.5.0 | |
@@ -768,7 +768,7 @@ if (isMainThread) { | |||
| 768 | 768 | } | |
| 769 | 769 | ``` | |
| 770 | 770 | ||
| 771 | - ## `worker.locks` | ||
| 771 | + ## `worker_threads.locks` | ||
| 772 | 772 | ||
| 773 | 773 | <!-- YAML | |
| 774 | 774 | added: v24.5.0 | |
@@ -2238,7 +2238,7 @@ thread spawned will spawn another until the application crashes. | |||
| 2238 | 2238 | [`data:` URL]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | |
| 2239 | 2239 | [`fs.close()`]: fs.md#fsclosefd-callback | |
| 2240 | 2240 | [`fs.open()`]: fs.md#fsopenpath-flags-mode-callback | |
| 2241 | - [`markAsUntransferable()`]: #workermarkasuntransferableobject | ||
| 2241 | + [`markAsUntransferable()`]: #worker_threadsmarkasuntransferableobject | ||
| 2242 | 2242 | [`node:cluster` module]: cluster.md | |
| 2243 | 2243 | [`perf_hooks.performance`]: perf_hooks.md#perf_hooksperformance | |
| 2244 | 2244 | [`perf_hooks` `eventLoopUtilization()`]: perf_hooks.md#performanceeventlooputilizationutilization1-utilization2 | |
@@ -2255,23 +2255,23 @@ thread spawned will spawn another until the application crashes. | |||
| 2255 | 2255 | [`process.stdout`]: process.md#processstdout | |
| 2256 | 2256 | [`process.threadCpuUsage()`]: process.md#processthreadcpuusagepreviousvalue | |
| 2257 | 2257 | [`process.title`]: process.md#processtitle | |
| 2258 | - [`require('node:worker_threads').isMainThread`]: #workerismainthread | ||
| 2258 | + [`require('node:worker_threads').isMainThread`]: #worker_threadsismainthread | ||
| 2259 | 2259 | [`require('node:worker_threads').parentPort.on('message')`]: #event-message | |
| 2260 | 2260 | [`require('node:worker_threads').parentPort.postMessage()`]: #workerpostmessagevalue-transferlist | |
| 2261 | - [`require('node:worker_threads').parentPort`]: #workerparentport | ||
| 2262 | - [`require('node:worker_threads').threadId`]: #workerthreadid | ||
| 2263 | - [`require('node:worker_threads').threadName`]: #workerthreadname | ||
| 2264 | - [`require('node:worker_threads').workerData`]: #workerworkerdata | ||
| 2261 | + [`require('node:worker_threads').parentPort`]: #worker_threadsparentport | ||
| 2262 | + [`require('node:worker_threads').threadId`]: #worker_threadsthreadid | ||
| 2263 | + [`require('node:worker_threads').threadName`]: #worker_threadsthreadname | ||
| 2264 | + [`require('node:worker_threads').workerData`]: #worker_threadsworkerdata | ||
| 2265 | 2265 | [`trace_events`]: tracing.md | |
| 2266 | 2266 | [`v8.getHeapSnapshot()`]: v8.md#v8getheapsnapshotoptions | |
| 2267 | 2267 | [`v8.getHeapStatistics()`]: v8.md#v8getheapstatistics | |
| 2268 | 2268 | [`vm`]: vm.md | |
| 2269 | - [`worker.SHARE_ENV`]: #workershare_env | ||
| 2269 | + [`worker.SHARE_ENV`]: #worker_threadsshare_env | ||
| 2270 | 2270 | [`worker.on('message')`]: #event-message_1 | |
| 2271 | 2271 | [`worker.postMessage()`]: #workerpostmessagevalue-transferlist | |
| 2272 | 2272 | [`worker.terminate()`]: #workerterminate | |
| 2273 | - [`worker.threadId`]: #workerthreadid_1 | ||
| 2274 | - [`worker.threadName`]: #workerthreadname_1 | ||
| 2273 | + [`worker.threadId`]: #workerthreadid | ||
| 2274 | + [`worker.threadName`]: #workerthreadname | ||
| 2275 | 2275 | [async-resource-worker-pool]: async_context.md#using-asyncresource-for-a-worker-thread-pool | |
| 2276 | 2276 | [browser `LockManager`]: https://developer.mozilla.org/en-US/docs/Web/API/LockManager | |
| 2277 | 2277 | [browser `MessagePort`]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort | |
| Back | FazBrowse Home | New Git URL |
0 commit comments