Skip to content

Arman19941113/html-diff

Repository files navigation

Html Diff

Generate HTML content with unified or side-by-side differences.

Install

pnpm add @armantang/html-diff

Quick Start

import '@armantang/html-diff/dist/index.css'
import HtmlDiff from '@armantang/html-diff'

const oldHtml = `<div>hello</div>`
const newHtml = `<div>hello world</div>`

const diff = new HtmlDiff(oldHtml, newHtml)
const unifiedContent = diff.getUnifiedContent()
const sideBySideContents = diff.getSideBySideContents()

Preview

unified differences

home

side-by-side differences

home