https://github.com/petertrr/kotlin-multiplatform-diff
Multiplaform kotlin library for calculating text differences. Based on java-diff-utils, supports JVM, JS and native targets.
https://github.com/petertrr/kotlin-multiplatform-diff
diff kmp kotlin kotlin-js kotlin-jvm kotlin-library kotlin-native multiplatform multiplatform-kotlin-library
Last synced: 8 months ago
JSON representation
Multiplaform kotlin library for calculating text differences. Based on java-diff-utils, supports JVM, JS and native targets.
- Host: GitHub
- URL: https://github.com/petertrr/kotlin-multiplatform-diff
- Owner: petertrr
- License: apache-2.0
- Created: 2021-02-18T08:23:56.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-22T20:51:20.000Z (8 months ago)
- Last Synced: 2025-03-29T08:08:38.545Z (8 months ago)
- Topics: diff, kmp, kotlin, kotlin-js, kotlin-jvm, kotlin-library, kotlin-native, multiplatform, multiplatform-kotlin-library
- Language: Kotlin
- Homepage:
- Size: 602 KB
- Stars: 93
- Watchers: 2
- Forks: 7
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
- awesome-kotlin-multiplatform - kotlin-multiplatform-diff - Multiplatform Kotlin library for calculating text differences. (Libraries / Utility)
README
# kotlin-multiplatform-diff

[](https://codecov.io/gh/petertrr/kotlin-multiplatform-diff)
[](https://github.com/petertrr/kotlin-multiplatform-diff/blob/main/LICENSE)
[](https://mvnrepository.com/artifact/io.github.petertrr)
[](https://github.com/KotlinBy/awesome-kotlin)
[](http://kotlinlang.org)
This is a port of [java-diff-utils](https://github.com/java-diff-utils/java-diff-utils) to Kotlin with multiplatform support.
All credit for the implementation goes to the original authors.
## Features
All features from version `4.15` of the original library are present, except for:
- fuzzy patches
- unified diff, which heavily uses file read/write and therefore needs a more complicated rewrite
- diff-utils-jgit, which uses JVM-only JGit
Refer to the [original wiki][1] for more information.
## Supported platforms
- JVM
- JS (browser and Node.js)
- WebAssembly (WASM/JS and WASM/WASI)
- Native
Supported Native targets are (following the Kotlin/Native [target support guidelines][2]):
| Tier 1 | Tier 2 | Tier 3 |
|:-----------|:-----------|:---------|
| macosX64 | linuxX64 | mingwX64 |
| macosArm64 | linuxArm64 | |
[1]: https://github.com/java-diff-utils/java-diff-utils/wiki
[2]: https://kotlinlang.org/docs/native-target-support.html