talira

Lightweight fuzzy-search library, with zero dependencies

open sourceApache-2.0self-hostablefree

Fuse.js is a zero-dependency fuzzy-search library written in TypeScript that runs in the browser, Node.js and other JavaScript runtimes. It searches arrays of strings or objects in memory with typo-tolerant matching, made for small-to-medium datasets where you don't want a dedicated search backend. Token search splits multi-word queries and ranks results with IDF, extended search adds exact, prefix, suffix, inverse and include operators, logical search combines conditions with $and and $or, and keys can be weighted or nested. FuseWorker spreads a large dataset across Web Workers to search in parallel without freezing the UI.

Problems it solves

  • add a search box with typo tolerance to a list in my web app without a search server
  • fuzzy match user input against a few thousand records on the client
  • search an array of objects across several fields and rank by relevance
  • a command palette that finds items even when the user misspells them
  • search a static site's content entirely in the browser
  • search a large in-memory dataset without freezing the UI

Features

  • fuzzy search with a bit-parallel matcher
  • token search with IDF ranking
  • extended search operators
  • logical $and / $or search
  • weighted and nested keys
  • match scores and indices
  • FuseWorker for Web Worker parallel search
  • zero dependencies

Limitations

  • Designed for small-to-medium datasets searched in memory, not as a replacement for a search server.1

Capabilities

Has official SDKsplan not known

Alternatives

The same job

These do what Fuse.js does.

  1. FlexSearch Fast full-text search library for the browser and Node.js
  2. pg_textsearch PostgreSQL extension for BM25 relevance-ranked full-text search
  3. Manticore Search Fast open source search database for full-text, vector and hybrid search, an Elasticsearch alternative

Compare Fuse.js with the top 3