Skip to content

jsdifflib is a Javascript library that provides a partial reimplementation of Python's difflib module (specifically, the SequenceMatcher class).

License

Notifications You must be signed in to change notification settings

litinskii/jsdifflib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsdifflib

jsdifflib is a Javascript library that provides a partial reimplementation of Python's difflib module (specifically, the SequenceMatcher class).

npm install https://github.com/w-site/jsdifflib.git
import { getInlineDiffsArray, getSideBySideDiffsArray } from 'jsdifflib'

API Reference

getInlineDiffsArray(first, second) ⇒ Array

Returns array of inline diffs.

Param Type Description
first String Base text to compare
second String New text to compare

getSideBySideDiffsArray(first, second) ⇒ Array

Returns arrays of diff side by side, each item of array (ex. array[2]) have 2 items:

  • Fist - diff from base text
  • Second - diff from new text
Param Type Description
first String Base text to compare
second String New text to compare

About

jsdifflib is a Javascript library that provides a partial reimplementation of Python's difflib module (specifically, the SequenceMatcher class).

Resources

License

Stars

Watchers

Forks

Packages

No packages published