Introduction

What is DocNode

DocNode is a highly performant type-safe document manager with atomic transactions and an undo manager. It supports Operational Transformation (OT) and in the future also a Conflict-free Replicated Data Type (CRDT) mode.

For the story behind DocNode and acknowledgements, see About.

How does it compare to Yjs?

FeatureDocNodeYjs
TypeID-based OTCRDT
Sync / Backend solutionDocSyncHocuspocus, Y-Sweet, DocSync
PricingFreeFree
LicenseA Fair Code LicenseMIT
Types of nodesDocNodeYMap, YArray, YText, YxmlFragment, YXmlElement, YXmlText
Bundle size (gzip)6.8 kb26.3 kb
Type-safe node schemas
Move operation
Hard deletes
Metadata-free inserts
P2P support
Schema normalization
Automatic batching
Node IDs are public

Why another CRDT / OT library?

  • Operational Transformation (OT): DocNode is the only actively maintained OT framework. Since it relies on a server, documents avoid soft-deletes and tombstones like CRDTs, keeping them compact. A CRDT mode is planned for scenarios requiring P2P collaboration.
  • Type-safety: TypeScript is a first-class citizen. You define the shape of your nodes, and DocNode ensures correct parsing and validation.
  • Performance: DocNode is incredibly fast. Updates are batched automatically, there's no double-buffering/virtual DOM, the event system is designed for fine-grained updates, and serialization is extremely small.
  • Simplicity: You don't need to worry about which data type to use, since there's only one (DocNode). This makes modeling your document a near-obvious task.
  • API Design: The API has gone through two years of iteration and refinement. Get ready for many aha moments.
  • Composability: DocNode is designed from the ground up to support independent extensions and customizations of documents, nodes, and features without conflicts.
  • Schema enforcement: Do you want your document to always start with a heading? Or never have more than five bullets in a row? DocNode lets you define your own Normalizers to enforce any structure you can imagine.

On this page

Edit on GitHub