Automerge is a library of data structures for building collaborative applications in JavaScript. github
A common approach to building JavaScript apps involves keeping the state of your application in model objects, such as a JSON document. For example, imagine you are developing a task-tracking app in which each task is represented by a card.
## Features and design principles - **Network-agnostic**. Automerge is a pure data structure library that does not care about what kind of network you use. It works with any connection-oriented network protocol, which could be client/server (e.g. WebSocket), peer-to-peer (e.g. WebRTC), or entirely local (e.g. Bluetooth). Bindings to particular networking technologies are handled by separate libraries; see the section on [Sending and receiving changes](https://github.com/automerge/automerge#sending-and-receiving-changes) for examples. It also works with unidirectional messaging: you can send an Automerge file as email attachment, or on a USB drive in the mail, and the recipient will be able to merge it with their version. - **Immutable state**. An Automerge object is an immutable snapshot of the application state at one point in time. Whenever you make a change, or merge in a change that came from the network, you get back a new state object reflecting that change. This fact makes Automerge compatible with the functional reactive programming style of [React](https://reactjs.org) and [Redux](http://redux.js.org/), for example. - **Automatic merging**. Automerge is a _Conflict-Free Replicated Data Type_ ([CRDT](https://crdt.tech/)), which allows concurrent changes on different devices to be merged automatically without requiring any central server. It is based on [academic research on JSON CRDTs](https://arxiv.org/abs/1608.03960), but the details of the algorithm in Automerge are different from the JSON CRDT paper, and we are planning to publish more detail about it in the future. - **Fairly portable**. We're not yet making an effort to support old platforms, but we have tested Automerge in Node.js, Chrome, Firefox, Safari, MS Edge, and [Electron](https://electron.atom.io/). For TypeScript users, Automerge comes with [type definitions](https://github.com/automerge/automerge/blob/main/@types/automerge/index.d.ts) that allow you to use Automerge in a type-safe way.