input-diff

1.0.3 • Public • Published

input-diff Build Status Coverage Status

When text input changes, the following premises are usually true:

  • If the new text is longer than the old, it means something was inserted
  • If the new text is shorter than the old, it means something was removed

input-diff finds the LCS when those premises are met, and a valid diff when they're not, with few iterations.

Sample usage

var diff = require('input-diff'),
    data;

data = diff.get('Hello','Hello world');
console.log( diff.apply('Hello',data) ); // Hello world

Readme

Keywords

none

Package Sidebar

Install

npm i input-diff

Weekly Downloads

8

Version

1.0.3

License

Apache-2.0

Last publish

Collaborators

  • manvalls