An open API service indexing awesome lists of open source software.

https://github.com/welpo/kawari

Local, private diffs; shareable URLs.
https://github.com/welpo/kawari

developer-tools diff local-first privacy vanilla-javascript webapp

Last synced: 5 days ago
JSON representation

Local, private diffs; shareable URLs.

Awesome Lists containing this project

README

          


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:

```bash
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!

- Questions or ideas → [start a discussion](https://github.com/welpo/kawari/discussions)
- Found a bug? → [report it here](https://github.com/welpo/kawari/issues/new?labels=bug)
- Feature request? → [let me know](https://github.com/welpo/kawari/issues/new?labels=feature)

## 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](./COPYING), either version 3 of the License, or (at your option) any later version.