A simple difference algorithm based on Swift's implementation.
NPM
npm install myers.js
Yarn
yarn add myers.js
-
myers(oldStr, newStr, [options])
Compare two inputs and return the differences.
Options
-
compare?: (a, b) => boolean
compare function. (defaultlodash.isEqual
) -
progress?: (ratio: { count: number; total: number; }) => void
callback function for report progress. -
debounce?: number
debounce in millisecond of progress report. (default0
)
-
import myers from 'myers.js';
const first = 'beep boop';
const second = 'beep boob blah';
const diff = await myers(first, second);
console.log(diff)