list-diff
Introduction
Diff two lists/strings in time O(n*m). The algorithm finding the minimal amount of moves(patches) is Levenshtein distance.
Install
$ npm install list-diff.js --save
Usage
var diff = var oldList = id: "a" id: "b" id: "c" id: "d" id: "e"var newList = id: "c" id: "a" id: "b" id: "e" id: "f" var patches = patches // now `oldList` is equal to `newList`// [{id: "c"}, {id: "a"}, {id: "b"}, {id: "e"}, {id: "f"}]console
License
MIT