json-string-matcher
v1.0.4
Published
A utility to compare JSON string values using Levenshtein similarity
Downloads
46
Readme
JSON String Matcher
A lightweight utility to compare two JSON objects by their string values using Levenshtein similarity.
🔍 It compares only matching keys and returns a similarity percentage.
✨ Features
- Case-insensitive string matching
- Uses
fastest-levenshteinfor performance - Ignores unmatched keys
- Simple average-based similarity score
📦 Installation
npm install json-string-matcher📦 example
import { matchJsonValues } from "json-string-matcher";
const jsonA = { a: "YOU", b: "Okay", c: "ohyess" }; const jsonB = { a: "you", b: "oke" };
const similarity = matchJsonValues(jsonA, jsonB);
console.log(Similarity: ${similarity}%);
