New:Socket for Asana Is Now Available.Learn more
Get Started

@jsonjoy.com/collaborative-codemirror

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsonjoy.com/collaborative-codemirror

Binding for collaborative editing support in CodeMirror Editor. Connects JSON CRDT str node to CodeMirror Editor.

latest
Source
npmnpm
Version
18.30.0
Version published
Maintainers
2
Created
Source

CodeMirror collaborative binding

Makes a plain CodeMirror editor instance collaborative by binding it to a JSON CRDT document str node. This allows multiple users to edit the same document json-joy JSON CRDT document concurrently through the CodeMirror editor.

collab-codemirror-demo

Usage

Installation:

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

Usage:

import {EditorView} from 'codemirror';
import {bind} from '@jsonjoy.com/collaborative-codemirror';
import {Model, s} from 'json-joy/lib/json-crdt';

// Create a JSON CRDT model.
const model = Model.create(s.str(''));

// Create a CodeMirror editor instance.
const editor = new EditorView({parent: div});

// Connect CodeMirror editor to JSON CRDT document "str" node.
const unbind = bind(() => model.s.toApi(), editor);

// When done, unbind the binding.
unbind();

Preview

  • See demo.

Keywords

codemirror

FAQs

Package last updated on 08 Sep 2026

Related posts