Fuse.js is an open source project and a popular JavaScript fuzzy-search library written and maintained by Kiro Risk.
Fuse.js is a lightweight, zero-dependency fuzzy-search library designed to provide powerful, typo-tolerant searching capabilities directly within the browser or server-side environments.
The main features of this tool include:
Fuzzy Search: It provides typo-tolerant matching powered by the Bitap algorithm, allowing users to find results even with spelling errors.
Zero Dependencies: The library is entirely self-contained and works seamlessly in the browser, Node.js, and Deno without requiring external packages.
Advanced Search Logic: It supports token search (splitting queries into terms ranked by IDF), logical search (using $and and $or expressions), and extended search (operators for exact, prefix, and suffix matching).
Weighted Keys: Developers can prioritize specific data fields, such as boosting the importance of a "title" over a "description" in search results.
Flexible Data Handling: It supports nested search using dot or array notation and can handle complex data structures through custom functions.
Extremely Lightweight: The library is highly optimized for performance, with the full build weighing approximately 8.6 kB (gzipped) and a basic version at just 6.8 kB.
Broad Platform Support: In addition to web environments, there is an official Swift port (fuse-swift) for Apple platforms like iOS, macOS, and visionOS.
Hosted Option: A forthcoming service called Fuse Cloud will offer the same fuzzy search capabilities as a hosted API, eliminating the need for client-side overhead.