Analysis updated 2026-07-08 · repo last pushed 2024-10-27
Build a collaborative writing tool that highlights what a co-author added or removed.
Create a note-taking app that shows edits between saved versions of a document.
Compare two JSON objects and see exactly which fields changed.
Generate and apply standard patch files for tracking text changes.
| joshuakgoldberg/jsdiff | 0xhassaan/nn-from-scratch | 0xzgbot/hermes-comfyui-skills | |
|---|---|---|---|
| Stars | — | 0 | 0 |
| Language | — | Python | — |
| Last pushed | 2024-10-27 | — | — |
| Maintenance | Stale | — | — |
| Setup difficulty | easy | moderate | easy |
| Complexity | 2/5 | 4/5 | 1/5 |
| Audience | developer | developer | designer |
Figures from each repo's GitHub metadata at analysis time.
Install via npm and import the diff functions directly, no external dependencies or configuration required.
jsdiff is a JavaScript library that compares two pieces of text and tells you exactly what changed between them. Think of it as the engine behind the "track changes" feature in a document editor or the red and green highlights you see when reviewing code changes online. It figures out which words, lines, or characters were added, deleted, or kept the same when going from an original version to a new one. At a high level, the library works in three steps. First, it chops both the old and new text into smaller pieces called "tokens." A token can be whatever you want: a single character, a whole word, a sentence, or an entire line. Second, it analyzes those tokens to find the smallest set of insertions and deletions needed to transform the old text into the new text. Finally, it hands you a straightforward list showing the sequence of changes, noting which tokens were added, removed, or left alone. You can tweak how it decides if two tokens are "equal," such as telling it to ignore uppercase and lowercase differences. The library is useful for anyone building an app that needs to show changes in text. For example, if you are building a collaborative writing tool and want to show users what their co-author just added, or a note-taking app that highlights edits between versions, this library does the heavy lifting for you. It includes specific tools for comparing different formats out of the box, like JSON objects, CSS code, or standard plain text, and can even generate and apply standard "patch" files used in software development. One notable thing about the project is its flexibility in how it handles different languages and granularities. For instance, it can break text into words using built-in internationalization tools, which means it can accurately identify word boundaries in languages like Chinese that don't use spaces. It also lets you set limits on how hard it works, so if you accidentally compare two massive, completely different documents, you can tell it to give up early rather than freezing your application.
jsdiff is a JavaScript library that compares two pieces of text and shows exactly what was added, deleted, or kept the same. It powers features like track changes in document editors.
Stale — no commits in 1-2 years (last push 2024-10-27).
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.