jsondiffpatch

smart array diffing using LCS, IMPORTANT NOTE: to match objects inside an array you must provide an objectHash function (this is how objects are matched, otherwise a dumb match by position is used). For more details, check Array diff documentation

jsondiffpatch-formatters.js builtin formatters (only those useful in a browser)

All these come in minified versions (.min.js), and separate sourcemap files.

Options

var jsondiffpatch =require('jsondiffpatch').create({
// used to match objects when diffing arrays, by default only === operator is usedobjectHash: function(obj) {
// this function is used only to when objects are not equal by refreturn obj._id || obj.id;
},
arrays: {
// default true, detect items moved inside the array (otherwise they will be registered as remove+add)
detectMove:true,
// default false, the value of items moved is not included in deltas
includeValueOnMove:false
},
textDiff: {
// default 60, minimum string length (left and right sides) to use text diff algorythm: google-diff-match-patch
minLength:60
}
});