0.3.0 • Published 4 years ago

sharedb-codemirror v0.3.0

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

ShareDB-CodeMirror Build Status Dependencies devDependency Status

CodeMirror bindings for ShareDB. Adapted from @aslakhellesoy's share-codemirror.

Usage

var CodeMirror = require('codemirror');
var ShareDBCodeMirror = require('sharedb-codemirror');

// ...

var codeMirror = CodeMirror.fromTextArea(elem);
ShareDBCodeMirror.attachDocToCodeMirror(shareDBDoc, codeMirror);

That's it. You now have two-way sync between ShareDB and CodeMirror. A full example is available in examples/.

Install with NPM

npm install sharedb-codemirror

Try it out

npm install
npm start
# in a couple of browsers...
open http://localhost:7007

Try clicking the infinite monkeys button. Do it in both browsers. Wait for poetry to appear.

Run tests

npm install
npm test

With test coverage:

npm run test-cover
open coverage/lcov-report/index.html
0.3.0

4 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago