Loro

High-performance CRDT library that makes JSON data collaborative and version-controlled

Library
npm
v1.14.1
6,049stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
87/100Excellent
Development Activity96
Maintenance100
Community56
Maturity56
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture88
Code Quality86
Innovation90
Learning Curve72

Loro is a Conflict-free Replicated Data Type (CRDT) library that lets applications treat rich JSON-like data (maps, lists, text, trees) as collaboratively editable and automatically mergeable across devices and offline periods, without a central server arbitrating conflicts. Its core is written in Rust and compiled to WebAssembly, exposed to JavaScript/TypeScript via the loro-crdt npm package, giving web apps native-speed CRDT operations.

Beyond basic merge semantics, Loro adds built-in version control — time-travel, branching, and diffing over the document’s history — plus a specialized rich-text CRDT type designed for real collaborative text editors (not just JSON merging). It targets local-first and offline-first application architectures where clients need to keep working without connectivity and reconcile changes automatically when they reconnect.

What You Get

  • CRDT container types for Map, List, Text, Tree, and MovableList that auto-merge concurrent edits
  • A Rust core compiled to WASM, exposed to JS/TS via the loro-crdt npm package for near-native performance in the browser
  • Built-in version control: checkout arbitrary history points, branch, and diff document versions
  • A dedicated rich-text CRDT type suited for real collaborative editors, distinct from plain JSON merge semantics
  • A compact binary export/import format for efficient sync and persistence
  • Native bindings beyond JS (Rust crate, with community bindings for other languages) sharing the same core

Common Use Cases

  • Building local-first apps (note-taking, whiteboards, documents) that keep working fully offline and sync automatically when reconnected
  • Powering real-time collaborative text editors that need conflict-free merging of concurrent typing
  • Adding undo/redo and version history to an app for free by using Loro’s built-in time-travel over document state
  • Syncing structured app state (not just documents) across multiple devices or tabs without a central authority resolving conflicts

Under The Hood

Architecture - The core CRDT algorithms live in the crates/loro/loro-internal Rust crates (shared logic for containers, operation log, and history), with loro-common providing shared types and loro-wasm compiling that core to WebAssembly and wrapping it in the TypeScript-friendly API published as loro-crdt; fractional_index, generic-btree, delta, and rle crates implement the underlying data structures (ordered position indices, run-length encoding, B-trees) that make Loro’s operation log compact and fast to replay.

Tech Stack - Rust for the CRDT engine and WASM compilation target, TypeScript for the loro-js bindings and public JS/TS API surface, with a pnpm/moon-based monorepo managing the JS packages and Cargo workspaces for the Rust crates; deny.toml/supply-chain files show active Rust dependency auditing.

Code Quality - The repo includes a dedicated fuzz crate for property/fuzz-testing the CRDT merge logic (critical correctness surface for any CRDT implementation), benchmarks directories on both the Rust and JS sides for tracking performance regressions, and CI running across the Rust and JS toolchains; commit velocity is high (26+ commits/month, 100 tagged releases) with an active Discord community and its own documentation site.

API Design - The container-based API (doc.getMap(), doc.getText(), doc.getList()) mirrors familiar JSON/collection APIs closely, keeping the learning curve low for developers without CRDT background, while version-control operations (doc.checkout(), doc.fork()) are clearly named and map onto git-like mental models developers already have.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search