Ended up being kinda sad that JS ecosystem's thread syncing libraries are kinda hit or miss and kinda patchy. The "idiomatic" javascript libraries that implement locks don't lend themselves too well to all the other fancy sync primitives from the Python or Java ecosystem.
So I created synchronization-atom, the "compare-and-set" of the JavaScript world.
It can 1: match a condition and apply an update to the condition as one atomic operation, or 2: have "threads" waiting for a condition to match before they unblock (via async await).
I had to implement both a Promise API and a callback API as Promises effective resolve on next tick, leaving some race conditions open. The callback API does not suffer from the same next-tick issue and are synchronous.
The README has example of implementing a few of the common sync primitives, with more to be documented soon (like channels or re-entrant locks).