same-diff
v0.0.2
Published
render text diffs similarly in different contexts
Readme
using diff-match-patch-es this library compares two texts, computes the changes between them, and renders them nicely for different environents:
npm install same-diff
JS API
import {diffCli, diffHtml, diffConsole } from 'same-diff'
let input='the best of times'
let output='the blurst of times'
// show a nice command-line diff
diffCli(input, output)
// render a nice HTML diff
let html = diffHtml(input, output)
document.body.innerHTML = html
// show a nice diff browser dev console
diffConsole(input, output)Output
diffHtml - basic stylable html
diffCli - command line output
diffConsole - browser dev console
CLI API
npm install -g same-diff
same-diff <input> <output>
same-diff ./input.txt ./output.txt --fmt=htmlMIT
