# rtfpessoa/diff2html

Pretty diff to html javascript library (diff2html)

Repository: https://github.com/rtfpessoa/diff2html
Canonical: https://ross.abutalabs.com/products/diff2html
Homepage: https://diff2html.xyz
Language: TypeScript
License: MIT
License Family: permissive
Topics: diff, parser, pretty, git, html, syntax-highlighting, diff2html, unified-diffs, colorized, typescript, javascript, hacktoberfest
Last push: 2026-05-08T22:05:30+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 81, release rhythm 31, longevity 100
- inputs: {"age_days": 4386, "days_push": 117, "days_rel": 244, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3398, forks 301 (observed 2026-08-28T04:08:02.651733+00:00)

## What it is
diff2html is a JavaScript/TypeScript library that parses git or unified diff output and generates pretty, GitHub-style HTML diffs with line-by-line and side-by-side views, syntax highlighting, and line similarity matching. It ships as an npm library, a browser bundle, and a companion CLI (diff2html-cli) for viewing diffs in the terminal-to-browser workflow.

## Use cases
- render git diffs as pretty html in a web app
- display side-by-side code changes in code review tooling
- view unified diff files with syntax highlighting in the browser
- show diff output from a git client or git gui
- preview build or snapshot diffs in ci tools
- convert diff text to colorized html from node.js

## When to choose
- you need to visualize git or unified diffs as HTML in a browser or Node.js app
- you want GitHub-like diff rendering with syntax highlighting out of the box
- you need both line-by-line and side-by-side diff views
- you're building a code review, git client, or diff-sharing tool in JavaScript

## When to avoid
- you need to compute or generate diffs from scratch rather than render existing diff text
- you need server-side rendering in a non-JavaScript stack
- you need a full diff/merge editor with interactive editing of changes
- you work with very large diffs where memory usage is a concern

## Facets
- artifact type: library
- maturity: active
- function: parser, templating, developer-tools
- domain: developer-tools, version-control, web-development, frontend
- platform: browser, cli, cross-platform
- tags: diff-viewer, unified-diff, git-diff, syntax-highlighting, code-review, html-generation, typescript, nodejs

## Member repositories
- rtfpessoa/diff2html (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:02.651733+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:38:47.598308+00:00, confidence not recorded.
  - readme: https://github.com/rtfpessoa/diff2html (fetched 2026-08-28T04:08:02.651733+00:00, sha a5bfd85be26f)
  - homepage: https://diff2html.xyz (fetched 2026-08-29T09:32:55.458181+00:00, sha 846f70fc1787)
- Data as of 2026-08-30T08:39:29.467469+00:00.
