automerge/automerge-classic ? reverse-engineered prompt

Reverse engineered prompt

Build me a JavaScript library for collaborative apps where the same document can be edited by different people at the same time, even while offline, and then merged back together without losing changes.

I want it to feel like working with a normal JSON style object, but with automatic conflict handling so two users can change different parts of the same data and the updates still combine cleanly. It should work in both Node and the browser, and include a simple way to create a document, make edits, merge remote changes, and inspect the current state.

Please include a solid test setup and make sure the package can be built for browser use too. Keep the public API easy to understand, with a few clear examples in the README or code comments so I can see how to use it right away. If you need to check current docs or implementation details, look them up online first.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab