Getting started

Introduction to @polgubau/fuzzy

Installation

Install the library using your package manager of choice:

npm i @polgubau/fuzzy

Basic Usage

Import the library and use it with a simple list:

index.ts
import  from '@polgubau/fuzzy';
 
const  = ["volvo", "seat", "mercedes", "audi", "bmw"];
const  = "volv"; // The search term
const  = ();
 
// Run this whenever the search term changes
const  = ();
.(); 

Are you using a framework?

We have special hooks and components for you if you use React or Vue. Check the Frameworks tabs for more information.

Response Structure

This code returns a list of results along with metadata about the search.

PropTypeDefault
results
Result<T>[]
""
length
number
0
time
number
0
normalizedQuery
string
""
hasExactMatch
boolean
false
bestMatch
Result<T>
null
hasResults
boolean
false
Edit on GitHub

Last updated on

On this page