hyper-p2p-crdt-two-phase-set
Two-phase set (add-set + remove-set) for add/remove membership.
Protocol: crdt-two-phase-set/v1
When to use
- Replicated allow/deny lists where removes must converge.
- Tag sets shared across peers.
When not to use
- Keys that are re-added after remove (2P-set keeps remove wins permanently).
- Ordered text (use RGA text).
Quick start
const { HyperP2PCrdtTwoPhaseSet } = require('hyper-p2p-crdt-two-phase-set')
const s = new HyperP2PCrdtTwoPhaseSet({ topic: 'tags' })
await s.ready()
s.add('vip')
s.remove('guest')
console.log(s.elements())
await s.close()
Docs
Test
npm install && npm test