Files
modules/state-crdts/hyper-p2p-crdt-rga-text
2026-05-20 22:56:32 -04:00
..
2026-05-20 22:56:32 -04:00
2026-05-20 22:56:32 -04:00
2026-05-20 22:56:32 -04:00
2026-05-20 21:19:52 -04:00
2026-05-20 22:56:32 -04:00
2026-05-20 21:57:50 -04:00
2026-05-20 21:57:50 -04:00
2026-05-20 22:56:32 -04:00

hyper-p2p-crdt-rga-text

RGA-style collaborative text (insert by index + charId, tombstone delete).

Protocol: crdt-rga-text/v1

When to use

  • Lightweight multi-peer text buffers (chat lines, shared notes).
  • Index-addressable inserts with stable character ids.

When not to use

  • Rich OT/CRDT editors needing fractional indexing at scale (use dedicated collab stack).
  • Binary blobs.

Quick start

const { HyperP2PCrdtRgaText } = require('hyper-p2p-crdt-rga-text')
const doc = new HyperP2PCrdtRgaText({ topic: 'notes' })
await doc.ready()
doc.insert(0, 'id-1', 'Hi')
doc.delete('id-1')
console.log(doc.toString())
await doc.close()

Docs

Test

npm install && npm test