Web Messaging

The MessageChannel, MessagePort, and MessageEvent globals.

MessageChannel, MessagePort, and MessageEvent are globals and follow the HTML Standard.

Differences from browsers

  • A channel connects ports in the same realm; it does not create a worker.
  • Structured clone copies primitives, arrays, plain objects, cycles, Date, RegExp, Map, Set, and ArrayBuffer.
  • Posting a function throws DataCloneError.

For workers, see node:worker_threads.