Skip to content
No description or website provided.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
src
.eslintrc
.gitignore
LICENSE
README.md
babel.config.js
jest.config.js
package.json
yarn.lock

README.md

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.

import compare from 'fuzzy-comparison';

if (compare('foo', 'foobar', { threshold: 4 })) {
  console.log(`It's a match!`);
}
You can’t perform that action at this time.