Skip to content

About

πŸ”€ GitHub-style text diff in your browser β€” split & unified views, word-level highlights, unified patch export, Myers algorithm. By Prism Protocol

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Prism Diff Viewer

Typing SVG

CI Live demo Vanilla JS Zero dependencies License

Prism Diff Viewer screenshot

⚑ Overview

Prism Diff Viewer compares two pieces of text or code and shows exactly what changed, the way you are used to seeing it on GitHub. It uses the Myers O(ND) algorithm for minimal diffs, pairs changed lines to highlight individual words, and exports a standard unified patch.

✨ Features

  • Split view with paired lines and word-level del / ins highlights
  • Unified view with old and new line numbers
  • Patch view: standard unified diff with 3 lines of context
  • Ignore whitespace / case options
  • Open files from disk, rename sides, swap, copy patch
  • Implemented with the Myers diff algorithm, no libraries

πŸ“Έ Screenshots

Prism Diff Viewer on desktop Prism Diff Viewer on mobile

πŸš€ Quick Start

Use it online: https://krishyaa06.github.io/prism-diff-viewer/

Run locally:

git clone https://github.com/krishyaa06/prism-diff-viewer.git
cd prism-diff-viewer
# open index.html in your browser, or serve it:
npx serve .

πŸ› οΈ Usage

  1. Paste the original on the left and the changed version on the right (or Open files).
  2. Pick Split, Unified or Patch.
  3. Copy patch to share or git apply it.

πŸ“ Project Structure

prism-diff-viewer/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ logo.png
β”‚   └── logo.svg
β”œβ”€β”€ css/
β”‚   β”œβ”€β”€ app.css
β”‚   └── prism.css
β”œβ”€β”€ js/
β”‚   β”œβ”€β”€ app.js   # UI rendering
β”‚   β”œβ”€β”€ core.js   # Myers diff, rows, unified patch β€” tested in Node
β”‚   └── prism.js
β”œβ”€β”€ test/
β”‚   └── core.test.js
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ index.html
└── package.json

πŸ§ͺ Tests

npm test

Tests use the built-in node:test runner, so there is nothing to install. CI runs them on Node 20 and 22.

🀝 Contributing

  1. Fork the repo and create a branch: git checkout -b feature/my-idea
  2. Make your change and add a test in test/
  3. Run npm test and open a Pull Request

πŸ”· Part of Prism Protocol

Prism Diff Viewer is one of the open-source tools built by Prism Protocol, a tech community where young builders learn, ship and compete together.

πŸ‘€ Author

Soumya Bhandare
Soumya Bhandare

Founder @ Prism Protocol
Discord
Instagram
X

πŸ“„ License

Released under the MIT License.

If you like this project, consider giving it a ⭐
"Build. Create. Compete." · Made with ⚑ by Prism Protocol

About

πŸ”€ GitHub-style text diff in your browser β€” split & unified views, word-level highlights, unified patch export, Myers algorithm. By Prism Protocol

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages