Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Collaborative plain text editor binding

Binds a generic plain text editor to a JSON CRDT str node, enabling real-time collaborative editing of <input>, <textarea>, and code editors like CodeMirror, Monaco, and Ace.

📖 Full documentation →

collaborative-str

Installation

npm install json-joy @jsonjoy.com/collaborative-str

Usage

The minimal integration implements only get() and set():

import {StrBinding} from '@jsonjoy.com/collaborative-str';

const unbind = StrBinding.bind(
  () => model.api.str(['path', 'to', 'string']),
  {
    get: () => input.value,
    set: (text) => { input.value = text; },
  },
  true,
);

For granular sync, implement more of the EditorFacade interface — see the full documentation.