Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 959 Bytes

README.md

File metadata and controls

29 lines (23 loc) · 959 Bytes

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