A small dependency-free library ranks and filters strings with fast fuzzy matching, highlighting, and optional prepared targets for large lists.
Overview
fuzzysort targets in-app search boxes and file pickers that need responsive fuzzy filtering over thousands of strings. It emphasizes low overhead and predictable ranking rather than heavyweight search infrastructure.
Core usage scores a query against one or many targets, supports multi-key searches on structured records, and can highlight matched spans in results. Version 4 moved to ESM, added snapshotting of immutable target lists for speed, and exposes score and highlight helpers suited to Web Workers where structured cloning strips getters.
Text normalization uses NFKD, diacritic stripping, and remapping of common quote, dash, slash, ellipsis, and lookalike characters, with fuzzysort.remap for custom mappings. Prepared targets and filtering out unrelated entries are documented performance tactics for large corpora.
The project ships with no runtime dependencies and is intended for browser bundlers as well as Node-style ESM environments.
Key features
- Fast fuzzy string ranking
- Multi-key search on records
- Match highlighting helpers
- Immutable target snapshots
- Character normalization and remap
- Web Worker-friendly score API
- Custom scoring hooks
- Zero npm dependencies
Use cases
- Command palette style filters
- Large file list search UIs
- Ranking titles and URLs together
- Worker-based search in the browser
- Emoji or game name pickers