Files
modules/state-crdts/hyper-p2p-reactive-state
2026-05-20 23:36:32 -04:00
..
2026-05-20 21:02:45 -04:00
2026-05-20 23:36:32 -04:00
2026-05-20 21:02:45 -04:00
2026-05-20 21:02:45 -04:00
2026-05-20 21:02:45 -04:00
2026-05-20 21:02:45 -04:00
2026-05-20 21:02:45 -04:00
2026-05-20 21:02:45 -04:00
2026-05-20 23:36:32 -04:00

hyper-p2p-reactive-state

Reactive LWW keyvalue state with Hyperswarm sync, Protomux snapshots/updates, and optional Hyperbee persistence.

Category: State CRDTs · Protocol: hyper-p2p-reactive-state/v1

When to use

Observable shared config/game state with offline reload, peer subscriptions, and merge by timestamp + peerId tie-break.

When not to use

Simple gossip CRDTs without persistence/events, or strict BFT ordering (use causal consensus).

Quick start

const { HyperP2PReactiveState } = require('hyper-p2p-reactive-state')
const state = new HyperP2PReactiveState({ topic: process.argv[2], memoryOnly: true })
await state.ready()
await state.set('score', 100)
state.subscribe('score', (c) => console.log(c))

Docs

Test

npm install && npm test
bare examples/basic.js