Skip to content

manvalls/input-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A diff well suited for text input

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published