| Crates.io | diffx-core |
| lib.rs | diffx-core |
| version | 0.6.1 |
| created_at | 2025-07-04 12:31:31.023999+00 |
| updated_at | 2025-12-11 08:57:46.014991+00 |
| description | Core library for diffx - blazing fast semantic diff engine for structured data. Zero-copy parsing, streaming support, memory-efficient algorithms |
| homepage | https://github.com/kako-jun/diffx |
| repository | https://github.com/kako-jun/diffx |
| max_upload_size | |
| id | 1737967 |
| size | 77,815 |
Semantic diff tool for structured data (JSON/YAML/TOML/XML/INI/CSV). Ignores key ordering and whitespace, shows only meaningful changes.
Traditional diff doesn't understand structure:
$ diff config_v1.json config_v2.json
< {
< "name": "myapp",
< "version": "1.0"
< }
> {
> "version": "1.1",
> "name": "myapp"
> }
A simple key reordering shows every line as changed.
diffx shows only semantic changes:
$ diffx config_v1.json config_v2.json
~ version: "1.0" -> "1.1"
# As CLI tool
cargo install diffx
# As library (Cargo.toml)
[dependencies]
diffx-core = "0.6"
# Basic
diffx file1.json file2.json
# Output example
~ version: "1.0" -> "1.1"
+ features[0]: "new-feature"
- deprecated: "old-value"
JSON, YAML, TOML, XML, INI, CSV (auto-detected by extension, use --format to override)
--output json|yaml # Machine-readable output
--quiet # Return only exit code (0: same, 1: diff found)
--ignore-keys-regex RE # Ignore keys matching regex
--array-id-key KEY # Identify array elements by KEY for comparison
--epsilon N # Float comparison tolerance
--ignore-case # Case-insensitive comparison
--ignore-whitespace # Ignore whitespace differences
-r, --recursive # Recursive directory comparison
+ Added- Removed~ Modified! Type changed# Detect config changes
if ! diffx config/prod.json config/staging.json --quiet; then
echo "Config has changed"
diffx config/prod.json config/staging.json --output json > changes.json
fi
# Compare ignoring timestamps and metadata
diffx api_v1.json api_v2.json --ignore-keys-regex "^(timestamp|updated_at)$"
MIT