Skip to content

welpo/kawari

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kawari logo: two overlapping documents, one green and one red, representing diff comparison

kawari

PRs welcome app status License Clean commits

Private diffs. Shareable URLs.

A privacy-focused diff tool. Paste two texts, see what changed. No accounts, no tracking, works offline.

Features

  • No server; everything runs locally in the browser
  • Share via URL: diffs are compressed and encoded in the URL
  • Works offline as an installable PWA
  • Minimap: visual overview for navigating large diffs
  • Drag and drop files directly into the text areas
  • Download patch files compatible with git apply
  • Ignore options: whitespace, quote style (" vs ')
  • Keyboard shortcuts:
    • Cmd/Ctrl+Enter: compare texts
    • j/n: next change
    • k/p: previous change
    • e: edit (back to input)
    • Shift+click on collapsed section: expand/collapse all

Contributing

Please do! I'd appreciate bug reports, improvements (however minor), suggestions…

The tool uses vanilla JavaScript, HTML, and CSS. To run locally:

  1. Clone the repository: git clone https://github.com/welpo/kawari.git
  2. Navigate to the app directory: cd diff/app
  3. Start a local server: python3 -m http.server
  4. Visit http://localhost:8000 in your browser

The important files are:

  • app.js: UI logic and event handling
  • diff.js: diff algorithms (Myers, Patience) and patch generation
  • diff.worker.js: Web Worker for off-main-thread diffing
  • styles.css: styles
  • index.html: structure

Tests

Tests live in tests/ and use Node's built-in test runner:

node --test tests/*.mjs
  • patch.test.mjs: verifies generated patches can be applied with git apply. Each test case in tests/cases/ has an original.txt and modified.txt.
  • normalization.test.mjs: tests whitespace/quote normalization logic.

Need help?

Something not working? Have an idea? Let me know!

License

kawari is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Sponsor this project

 

Contributors