Skip to content

Apozhidaev/sdiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdiff

gets diff between two strings

var sdiff = require('sdiff');

var source = 'aaabbc';
var target = 'aaajjc';

var changes = sdiff.pull(source, target, { chunk: 1 }); 

// changes  =
//   [{
//        start: 0,
//        length: 3
//    },
//    {
//        value: 'jj'
//    },
//    {
//        start: 5,
//        length: 1
//    }];

// send changes by network

target === sdiff.push(source, changes); // true

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages