Implement collaboration effortlessly. Powered by CRDTs.
Built for local-first software.

ReimagineStateManagementwithCRDTs

✨ Loro 1.0 is released!
Read the announcement to learn more

Follow us on GitHub

High Performance

Optimized for memory, CPU, and loading speed with advanced performance primitives.

Rich CRDT Types Support

Turn JSON-like data into collaborative types effortlessly

Real-Time Collaboration with Version Control

Preserve full version history like Git, even during real-time collaboration

Simple and Intuitive API

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!

Rich CRDTs Algorithm Support

Basic Data Structures

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.

Text/List Editing with Fugue

Loro integrates Fugue, a novel CRDT algorithm designed to minimize the interleaving anomalies when merging concurrent text/list edits.

Rich Text with Peritext-like CRDT

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.