@@ -612,6 +612,21 @@ added: v10.5.0
612
612
The ` 'online' ` event is emitted when the worker thread has started executing
613
613
JavaScript code.
614
614
615
+ ### ` worker.getHeapSnapshot() `
616
+ <!-- YAML
617
+ added: v13.9.0
618
+ -->
619
+
620
+ * Returns: {Promise} A promise for a Readable Stream containing
621
+ a V8 heap snapshot
622
+
623
+ Returns a readable stream for a V8 snapshot of the current state of the Worker.
624
+ See [ ` v8.getHeapSnapshot() ` ] [ ] for more details.
625
+
626
+ If the Worker thread is no longer running, which may occur before the
627
+ [ ` 'exit' ` event] [ ] is emitted, the returned ` Promise ` will be rejected
628
+ immediately with an [ ` ERR_WORKER_NOT_RUNNING ` ] [ ] error.
629
+
615
630
### ` worker.postMessage(value[, transferList]) `
616
631
<!-- YAML
617
632
added: v10.5.0
@@ -685,21 +700,6 @@ inside the worker thread. If `stdout: true` was not passed to the
685
700
[ ` Worker ` ] [ ] constructor, then data will be piped to the parent thread's
686
701
[ ` process.stdout ` ] [ ] stream.
687
702
688
- ### ` worker.takeHeapSnapshot() `
689
- <!-- YAML
690
- added: v13.9.0
691
- -->
692
-
693
- * Returns: {Promise} A promise for a Readable Stream containing
694
- a V8 heap snapshot
695
-
696
- Returns a readable stream for a V8 snapshot of the current state of the Worker.
697
- See [ ` v8.getHeapSnapshot() ` ] [ ] for more details.
698
-
699
- If the Worker thread is no longer running, which may occur before the
700
- [ ` 'exit' ` event] [ ] is emitted, the returned ` Promise ` will be rejected
701
- immediately with an [ ` ERR_WORKER_NOT_RUNNING ` ] [ ] error.
702
-
703
703
### ` worker.terminate() `
704
704
<!-- YAML
705
705
added: v10.5.0
0 commit comments