Fuse.js is a zero-dependency fuzzy-search package for JavaScript and TypeScript. It targets small-to-medium datasets in the browser or on Node when no dedicated search backend is available.
Overview
Fuse.js helps applications find records despite typos, misspellings, and partial input. It uses a bit-parallel approximate matching approach and runs in the browser or on the server without extra dependencies.
You can search multiple fields with per-field weights, combine conditions with logical operators, and use extended operators for exact, prefix, suffix, and contains matching. Token search splits multi-word queries, fuzzy-matches each term, and ranks hits with IDF-style weighting. Match highlighting exposes character indices for UI highlighting, and you can update indexed collections without a full rebuild.
Optional Web Workers run searches on large collections in parallel so the main thread stays responsive. The package ships full and basic builds: the full build adds extended, logical, and token search; the basic build keeps bundle size smaller when only core fuzzy matching is needed. A one-off Fuse.match API compares a pattern to a single string without building an index.
Installation is via npm or CDN. Official ports include Swift for Apple platforms. API reference and interactive demos live on fusejs.io.
Key features
- Typo-tolerant fuzzy matching
- Multi-field weighted search
- Token search with relevance ranking
- Extended and logical query operators
- Object-based query syntax
- Web Worker parallel search
- Dynamic index updates
- Full and basic bundle variants
Use cases
- Client-side filtering of modest datasets
- In-app search without a search server
- Autocomplete with typo tolerance
- Multi-field record lookup in SPAs