fuzzy-comparison
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Fuzzy Comparison

Do you need to know if two strings are kind of the same? This package compares two string and tells you if they are similar enough.

CircleCI NPM Version License

yarn add fuzzy-comparison

Usage

import compare from 'fuzzy-comparison';
 
if (compare('Hello', 'Hallo')) {
  console.log(`It's a match!`);
}

You can adjust how sensitive the comparison is by adjusting the threshold which has a default value of 2.

import compare from 'fuzzy-comparison';
 
if (compare('foo', 'foobar', { threshold: 4 })) {
  console.log(`It's a match!`);
}

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i fuzzy-comparison

    Weekly Downloads

    76

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    15.4 kB

    Total Files

    16

    Last publish

    Collaborators

    • artmann