0.0.2 • Published 7 years ago

diff-text v0.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

diff-text

Inline text diff algorithm. Simplified from https://neil.fraser.name/writing/diff/. For input text diff in HTML with Chinese input software.

Build Status Coverage Status

Usage

npm i --save diff-text

var diffText = require('diff-text');

diffText('diff---text', 'diff+++text');

// will get array like below:
[
	[0, 'diff'], // equal
	[-1, '---'], // delete
	[1, '+++'],  // add
	[0, 'text']  // equal
]

Test & Perf

> npm run test

> npm run pref

diff-text x 1,238,388 ops/sec ±1.22% (88 runs sampled)

License

ISC@ProtoTeam.