High Performance
Optimized for memory, CPU, and loading speed with advanced performance primitives.
Implement collaboration effortlessly. Powered by CRDTs.
Built for local-first software.
✨ Loro 1.0 is released!
Read the announcement to learn more
Optimized for memory, CPU, and loading speed with advanced performance primitives.
Turn JSON-like data into collaborative types effortlessly
Preserve full version history like Git, even during real-time collaboration
Designed with developer experience in mind
Rich Text Editor Demo
Effortless Document Synchronization,
Even in P2P Environments
import { LoroDoc, VersionVector } from "npm:loro-crdt@1.0.0-beta.5";
const docA = new LoroDoc();
const docB = new LoroDoc();
docA.setPeerId(0); // You don't need to set peer id manually
docA.setPeerId(1); // This example set peer id for deterministic result
docA.getText("text").insert(0, "Hello!");
docB.getText("text").insert(0, "Hi!");
const bytesA: Uint8Array = docA.export({ mode: "update" });
const bytesB: Uint8Array = docB.export({ mode: "update" });
// Exchange bytesA and bytesB via any methods
docB.import(bytesA);
docA.import(bytesB);
// The merge result is consistent
console.log(docA.getText("text").toString()); // Hello!Hi!
console.log(docB.getText("text").toString()); // Hello!Hi!
Includes support for MovableList
for ordered collections, LWW (Last Write Win) Map
for key-value pairs, MovableTree
for hierarchical data, and Text
for rich text manipulation, enabling various of applications.
Loro integrates Fugue, a novel CRDT algorithm designed to minimize the interleaving anomalies when merging concurrent text/list edits.
Drawing inspiration from Peritext, Loro manages rich text CRDTs that excel at merging concurrent rich text style edits, maintaining the original intent of each user's input as much as possible. Please read our blog, Loro's Rich Text CRDT, to learn more.
For applications requiring directory-like data manipulation, Loro utilizes the algorithm from A Highly-Available Move Operation for Replicated Trees, simplifying moving and reorganizing hierarchical data structures.