parentPort
In Node.js, parentPort is a global available to worker threads that represents the communication channel back to the spawning thread. It is a MessagePort object that enables two-way messaging between a worker and its parent.
The property exists only inside worker threads. In the main thread, there is no parentPort. To use
From the worker, messages can be sent to the parent with parentPort.postMessage(value). The worker can also receive
The parentPort object conforms to the MessagePort interface and can be closed with close() when communication