@@ -53,7 +53,7 @@ When implementing a worker pool, use the [`AsyncResource`][] API to inform
5353diagnostic tools (e.g. in order to provide asynchronous stack traces) about the
5454correlation between tasks and their outcomes.
5555
56- ## worker.isMainThread
56+ ## ` worker.isMainThread `
5757<!-- YAML
5858added: v10.5.0
5959-->
@@ -74,7 +74,7 @@ if (isMainThread) {
7474}
7575```
7676
77- ## worker.moveMessagePortToContext(port, contextifiedSandbox)
77+ ## ` worker.moveMessagePortToContext(port, contextifiedSandbox) `
7878<!-- YAML
7979added: v11.13.0
8080-->
@@ -98,7 +98,7 @@ However, the created `MessagePort` will no longer inherit from
9898[ ` EventEmitter ` ] [ ] , and only [ ` port.onmessage() ` ] [ ] can be used to receive
9999events using it.
100100
101- ## worker.parentPort
101+ ## ` worker.parentPort `
102102<!-- YAML
103103added: v10.5.0
104104-->
@@ -129,7 +129,7 @@ if (isMainThread) {
129129}
130130```
131131
132- ## worker.receiveMessageOnPort(port)
132+ ## ` worker.receiveMessageOnPort(port) `
133133<!-- YAML
134134added: v12.3.0
135135-->
@@ -157,7 +157,7 @@ console.log(receiveMessageOnPort(port2));
157157When this function is used, no ` 'message' ` event will be emitted and the
158158` onmessage ` listener will not be invoked.
159159
160- ## worker.resourceLimits
160+ ## ` worker.resourceLimits `
161161<!-- YAML
162162added: v13.2.0
163163-->
@@ -173,7 +173,7 @@ this matches its values.
173173
174174If this is used in the main thread, its value is an empty object.
175175
176- ## worker.SHARE_ENV
176+ ## ` worker.SHARE_ENV `
177177<!-- YAML
178178added: v11.14.0
179179-->
@@ -192,7 +192,7 @@ new Worker('process.env.SET_IN_WORKER = "foo"', { eval: true, env: SHARE_ENV })
192192 });
193193```
194194
195- ## worker.threadId
195+ ## ` worker.threadId `
196196<!-- YAML
197197added: v10.5.0
198198-->
@@ -203,7 +203,7 @@ An integer identifier for the current thread. On the corresponding worker object
203203(if there is any), it is available as [ ` worker.threadId ` ] [ ] .
204204This value is unique for each [ ` Worker ` ] [ ] instance inside a single process.
205205
206- ## worker.workerData
206+ ## ` worker.workerData `
207207<!-- YAML
208208added: v10.5.0
209209-->
@@ -224,7 +224,7 @@ if (isMainThread) {
224224}
225225```
226226
227- ## Class: MessageChannel
227+ ## Class: ` MessageChannel `
228228<!-- YAML
229229added: v10.5.0
230230-->
@@ -244,7 +244,7 @@ port2.postMessage({ foo: 'bar' });
244244// Prints: received { foo: 'bar' } from the `port1.on('message')` listener
245245```
246246
247- ## Class: MessagePort
247+ ## Class: ` MessagePort `
248248<!-- YAML
249249added: v10.5.0
250250-->
@@ -259,7 +259,7 @@ structured data, memory regions and other `MessagePort`s between different
259259With the exception of ` MessagePort ` s being [ ` EventEmitter ` ] [ ] s rather
260260than [ ` EventTarget ` ] [ ] s, this implementation matches [ browser ` MessagePort ` ] [ ] s.
261261
262- ### Event: 'close'
262+ ### Event: ` 'close' `
263263<!-- YAML
264264added: v10.5.0
265265-->
@@ -281,7 +281,7 @@ port1.postMessage('foobar');
281281port1 .close ();
282282```
283283
284- ### Event: 'message'
284+ ### Event: ` 'message' `
285285<!-- YAML
286286added: v10.5.0
287287-->
@@ -294,7 +294,7 @@ input of [`port.postMessage()`][].
294294Listeners on this event will receive a clone of the ` value ` parameter as passed
295295to ` postMessage() ` and no further arguments.
296296
297- ### port.close()
297+ ### ` port.close() `
298298<!-- YAML
299299added: v10.5.0
300300-->
@@ -306,7 +306,7 @@ This method can be called when no further communication will happen over this
306306The [ ` 'close' ` event] [ ] will be emitted on both ` MessagePort ` instances that
307307are part of the channel.
308308
309- ### port.postMessage(value\ [ , transferList\] )
309+ ### ` port.postMessage(value[, transferList]) `
310310<!-- YAML
311311added: v10.5.0
312312-->
@@ -387,7 +387,7 @@ posting without having side effects.
387387For more information on the serialization and deserialization mechanisms
388388behind this API, see the [ serialization API of the ` v8 ` module] [ v8.serdes ] .
389389
390- ### port.ref()
390+ ### ` port.ref() `
391391<!-- YAML
392392added: v10.5.0
393393-->
@@ -400,7 +400,7 @@ If listeners are attached or removed using `.on('message')`, the port will
400400be ` ref() ` ed and ` unref() ` ed automatically depending on whether
401401listeners for the event exist.
402402
403- ### port.start()
403+ ### ` port.start() `
404404<!-- YAML
405405added: v10.5.0
406406-->
@@ -415,7 +415,7 @@ Node.js also diverges in its handling of `.onmessage`. Setting it will
415415automatically call ` .start() ` , but unsetting it will let messages queue up
416416until a new handler is set or the port is discarded.
417417
418- ### port.unref()
418+ ### ` port.unref() `
419419<!-- YAML
420420added: v10.5.0
421421-->
@@ -428,7 +428,7 @@ If listeners are attached or removed using `.on('message')`, the port will
428428be ` ref() ` ed and ` unref() ` ed automatically depending on whether
429429listeners for the event exist.
430430
431- ## Class: Worker
431+ ## Class: ` Worker `
432432<!-- YAML
433433added: v10.5.0
434434-->
@@ -503,7 +503,7 @@ if (isMainThread) {
503503}
504504```
505505
506- ### new Worker(filename\ [ , options\] )
506+ ### ` new Worker(filename[, options]) `
507507<!-- YAML
508508added: v10.5.0
509509changes:
@@ -560,7 +560,7 @@ changes:
560560 * ` codeRangeSizeMb ` {number} The size of a pre-allocated memory range
561561 used for generated code.
562562
563- ### Event: 'error'
563+ ### Event: ` 'error' `
564564<!-- YAML
565565added: v10.5.0
566566-->
@@ -570,7 +570,7 @@ added: v10.5.0
570570The ` 'error' ` event is emitted if the worker thread throws an uncaught
571571exception. In that case, the worker will be terminated.
572572
573- ### Event: 'exit'
573+ ### Event: ` 'exit' `
574574<!-- YAML
575575added: v10.5.0
576576-->
@@ -582,7 +582,7 @@ exited by calling [`process.exit()`][], the `exitCode` parameter will be the
582582passed exit code. If the worker was terminated, the ` exitCode ` parameter will
583583be ` 1 ` .
584584
585- ### Event: 'message'
585+ ### Event: ` 'message' `
586586<!-- YAML
587587added: v10.5.0
588588-->
@@ -593,15 +593,15 @@ The `'message'` event is emitted when the worker thread has invoked
593593[ ` require('worker_threads').parentPort.postMessage() ` ] [ ] .
594594See the [ ` port.on('message') ` ] [ ] event for more details.
595595
596- ### Event: 'online'
596+ ### Event: ` 'online' `
597597<!-- YAML
598598added: v10.5.0
599599-->
600600
601601The ` 'online' ` event is emitted when the worker thread has started executing
602602JavaScript code.
603603
604- ### worker.postMessage(value\ [ , transferList\] )
604+ ### ` worker.postMessage(value[, transferList]) `
605605<!-- YAML
606606added: v10.5.0
607607-->
@@ -613,7 +613,7 @@ Send a message to the worker that will be received via
613613[ ` require('worker_threads').parentPort.on('message') ` ] [ ] .
614614See [ ` port.postMessage() ` ] [ ] for more details.
615615
616- ### worker.ref()
616+ ### ` worker.ref() `
617617<!-- YAML
618618added: v10.5.0
619619-->
@@ -623,7 +623,7 @@ Opposite of `unref()`, calling `ref()` on a previously `unref()`ed worker will
623623behavior). If the worker is ` ref() ` ed, calling ` ref() ` again will have
624624no effect.
625625
626- ### worker.resourceLimits
626+ ### ` worker.resourceLimits `
627627<!-- YAML
628628added: v13.2.0
629629-->
@@ -639,7 +639,7 @@ this matches its values.
639639
640640If the worker has stopped, the return value is an empty object.
641641
642- ### worker.stderr
642+ ### ` worker.stderr `
643643<!-- YAML
644644added: v10.5.0
645645-->
@@ -651,7 +651,7 @@ inside the worker thread. If `stderr: true` was not passed to the
651651[ ` Worker ` ] [ ] constructor, then data will be piped to the parent thread's
652652[ ` process.stderr ` ] [ ] stream.
653653
654- ### worker.stdin
654+ ### ` worker.stdin `
655655<!-- YAML
656656added: v10.5.0
657657-->
@@ -662,7 +662,7 @@ If `stdin: true` was passed to the [`Worker`][] constructor, this is a
662662writable stream. The data written to this stream will be made available in
663663the worker thread as [ ` process.stdin ` ] [ ] .
664664
665- ### worker.stdout
665+ ### ` worker.stdout `
666666<!-- YAML
667667added: v10.5.0
668668-->
@@ -674,7 +674,7 @@ inside the worker thread. If `stdout: true` was not passed to the
674674[ ` Worker ` ] [ ] constructor, then data will be piped to the parent thread's
675675[ ` process.stdout ` ] [ ] stream.
676676
677- ### worker.terminate()
677+ ### ` worker.terminate() `
678678<!-- YAML
679679added: v10.5.0
680680changes:
@@ -692,7 +692,7 @@ Stop all JavaScript execution in the worker thread as soon as possible.
692692Returns a Promise for the exit code that is fulfilled when the
693693[ ` 'exit' ` event] [ ] is emitted.
694694
695- ### worker.threadId
695+ ### ` worker.threadId `
696696<!-- YAML
697697added: v10.5.0
698698-->
@@ -703,7 +703,7 @@ An integer identifier for the referenced thread. Inside the worker thread,
703703it is available as [ ` require('worker_threads').threadId ` ] [ ] .
704704This value is unique for each ` Worker ` instance inside a single process.
705705
706- ### worker.unref()
706+ ### ` worker.unref() `
707707<!-- YAML
708708added: v10.5.0
709709-->
0 commit comments