Text-diff

text-diff

HTML formatted text diff!

text-diff is an implementation of diff-match-patch which is a high-performance library in multiple languages that manipulates plain text.

Get it: npm install text-diff

Sample usage:

1
2
3
4
5
const Diff = require('text-diff');

const diff = new Diff(); // options may be passed to constructor; see below
const textDiff = diff.main('text1', 'text2'); // produces diff array
diff.prettyHtml(textDiff); // produces a formatted HTML string

GIF FTW!

text-diff

Suggest a module

Comments