The library uses SharedArrayBuffer to achieve this! This feature already provides true shared-memory multithreading to JavaScript, but you can only share raw bytes which is awkward. Therefore, my library is able to serialize every JavaScript value into this buffer and returns wrappers that look and behave like normal JavaScript objects, but really read from and write to this buffer under the hood.
Currently, I have support for the following types: numbers, bools, string, boxed primitives, null, undefined, bigint, objects, arrays, Map, Set, Date, TypedArray, DataView, Error, and RegExp. All reference types maintain their identity across the thread boundary.
The core engineering challenge is how to best represent these objects in memory so that they still remain fast despite the high dynamism of JavaScript!