@list-positions/crdts
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

@list-positions/crdts

A collection of CRDTs built on top of the list-positions library.

This package is meant as an example of how to use list-positions, not a production CRDT library. So take a look at the source code.

About

list-positions provides local data structures that implement the core of a list/text CRDT but with a different API. This package wraps those data structures to create more traditional CRDTs.

Specifically, this package's classes are all hybrid op-based/state-based CRDTs that tolerate duplicated and out-of-order messages (in op-based usage) and support state-based merging (state-based usage).

API

Classes:

  • ListCrdt<T>
  • TextCrdt

Types:

  • ListCrdtMessage<T>, TextCrdtMessage: Op-based message types.
  • ListCrdtSavedState<T>, TextCrdtSavedState: State-based state types. Can also be used for ordinary saving and loading.

The types are all JSON objects. You can serialize them with JSON.stringify (possibly GZIP'd) or design more efficient binary formats if you like.

Package Sidebar

Install

npm i @list-positions/crdts

Weekly Downloads

5

Version

0.2.1

License

MIT

Unpacked Size

90.4 kB

Total Files

24

Last publish

Collaborators

  • mweidner037