kpdecker/jsdiff

A javascript text differencing implementation.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 21 minutes ago
Added to GitGenius on September 7th, 2026
Created on March 29th, 2011
Open Issues & Pull Requests: 21 (+0)
GitHub issues: Enabled
Number of forks: 540
Total Stargazers: 9,205 (+0)
Total Subscribers: 94 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 25.2 hours
Mean response time: 50.2 days
90th percentile: 108.0 days
Tracked items: 58

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 11% of issues opened in the past year have been closed. Three people close 88% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 9
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 1,269 days
Stale 30+ days: 7
Stale 90+ days: 6

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (4)
  • question (4)
  • minor-feature-request (3)
  • merge (2)
  • performance (2)
  • diffWords behaviour (1)
  • major-new-feature (1)
  • planned-for-next-release (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

jsdiff is a JavaScript text differencing library that computes the minimal set of changes needed to transform one text into another.

The tool solves the problem of identifying what has changed between two versions of text. It works by tokenizing both input strings according to a specified granularity (characters, words, lines, or sentences), then applying the Myers difference algorithm to find the smallest set of insertions and deletions that transform the first token array into the second. The algorithm returns an ordered array of change objects representing each insertion, deletion, or unchanged section. The tool supports configurable equality semantics, such as case-insensitive comparison, which affects how tokens are matched during the diff computation.

Developers should choose this tool when they need programmatic access to text differences in a JavaScript environment. It suits projects requiring character-level, word-level, line-level, or sentence-level diffs, and it works both in Node.js and browser contexts through ESM imports, CommonJS requires, or a global API. The library is particularly useful when you need fine-grained control over what constitutes a token and how equality is determined between tokens, rather than just a human-readable diff output.

The project maintains a stable, focused codebase centered on the core differencing algorithms. Development activity shows consistent attention to the implementation without frequent breaking changes, suggesting the API has reached a mature state. The tool includes an interactive online demo that allows users to experiment with different diff functions and options before integrating the library into their own code.