
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
Effortless and fast string similarity comparison using multiple algorithms, including bigrams, Levenshtein, Jaro-Winkler, and Ratcliff/Obershelp. Perfect for fuzzy search, NLP, and intelligent text matching.
stringwise is a fast and lightweight TypeScript library for comparing string similarity using multiple algorithms like bigrams, Levenshtein, Jaro-Winkler, and Ratcliff/Obershelp. It’s ideal for fuzzy searching, intelligent suggestions, and natural language processing tasks where accuracy and performance matter.
default, levenshtein, jaro-winkler, or ratcliff-obershelp.round option to control rating precision.Install via npm or yarn:
npm install stringwise
or
yarn add stringwise
import { compareTwoStrings, findBestMatch, getSimilarityFn } from "stringwise";
compareTwoStrings("hello", "h3llo"); // e.g. 0.5
const result = findBestMatch("hello", ["halo", "hell", "hello", "world"]);
console.log(result.bestMatch);
// { target: 'hello', rating: 1 }
console.log(result.ratings);
/*
[
{ target: 'halo', rating: 0.2857142857142857 },
{ target: 'hell', rating: 0.8571428571428571 },
{ target: 'hello', rating: 1 },
{ target: 'world', rating: 0 }
]
*/
const result = findBestMatch("kitten", ["sitting"], {
algorithm: "levenshtein",
round: 3,
});
const sim = getSimilarityFn("jaro-winkler");
console.log(sim("MARTHA", "MARHTA")); // ~0.9611
compareTwoStrings(a: string, b: string): numberReturns a similarity score between 0 and 1 using bigram overlap.
findBestMatch(main: string, targets: string[], options?: FindBestMatchOptions): FindBestMatchResultReturns an object containing:
bestMatch: The string with the highest similaritybestMatchIndex: Index in the original listratings: All similarity scoresOptions:
type FindBestMatchOptions = {
round?: number; // Decimal places
algorithm?: "default" | "levenshtein" | "jaro-winkler" | "ratcliff-obershelp";
};
getSimilarityFn(algorithm: string): (a: string, b: string) => numberReturns the similarity function for a given algorithm name.
type MatchRating = {
target: string;
rating: number;
};
type FindBestMatchResult = {
bestMatch: MatchRating;
bestMatchIndex: number;
ratings: MatchRating[];
};
Licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Whether it's a bug fix, feature, or idea — feel free to open a pull request.
git checkout -b my-featuregit commit -m 'feat: awesome feature'Created by Kledenai
📫 me@kledenai.com
🌍 github.com/kledenai
FAQs
Effortless and fast string similarity comparison using multiple algorithms, including bigrams, Levenshtein, Jaro-Winkler, and Ratcliff/Obershelp. Perfect for fuzzy search, NLP, and intelligent text matching.
We found that stringwise demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.