差异操作将json diffs转换为ShareJS操作

安装:


$ npm install --save diffop

用法:


var diffop = require('diffop');

var json = require('ottypes').json0;

// Some document controlled through non-ShareJS methods.

var myDoc = /*...*/;

// ShareJS JSON0 document.

var shareDoc = /*...*/;

// Generate all needed operations to bring shareDoc up to date

// with the content of myDoc.

var ops = diffop(shareDoc);