Fuse.js

Lightweight, zero-dependency fuzzy-search library for JavaScript and TypeScript, in the browser or on the server.

Library
npm
v7.5.0
20,509 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
58 /100 Fair
Development Activity 28
Maintenance 40
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 87
Code Quality 88
Innovation 85
Learning Curve 90

Fuse.js is a lightweight, zero-runtime-dependency fuzzy-search library written in TypeScript. It implements the Bitap approximate string-matching algorithm so searches tolerate typos and partial matches without a dedicated search backend, making it a natural fit for filtering small-to-medium datasets entirely on the client.

Beyond basic fuzzy matching, Fuse.js supports weighted multi-field keys, an extended-search syntax with exact/prefix/suffix operators, logical $and/$or query composition, match-index highlighting, and an opt-in token-search mode with BM25-style relevance ranking for multi-word queries. A companion FuseWorker build offloads indexing and search to Web Workers for large datasets without blocking the UI thread.

What You Get

  • Core Fuse class implementing Bitap fuzzy matching with configurable threshold, distance, and location tuning
  • Weighted multi-key search so fields like title can outrank fields like description in relevance scoring
  • Extended search syntax (=, ^, !, etc.) and logical $and/$or query composition for precise filtering
  • Token search mode with per-word typo tolerance and BM25-style IDF ranking for multi-word queries
  • FuseWorker build that shards documents across Web Workers for parallel search on large datasets
  • Match-index highlighting output (includeMatches) for building highlighted search-result UIs
  • Dual ESM/CJS builds plus a smaller “basic” build (fuzzy search only) for bundle-size-sensitive apps

Common Use Cases

  • Client-side search-as-you-type over a product catalog, docs site, or command palette without a backend search index
  • Fuzzy filtering of autocomplete/typeahead suggestions that tolerate user typos
  • Ranking and highlighting matches across multiple weighted fields (e.g. title vs. body) in a search results list
  • Offloading fuzzy search for large in-memory datasets to a Web Worker so the main thread stays responsive

Under The Hood

Architecture — The public entry point (src/entry.ts) wires up the Fuse class (src/core/index.ts) with pluggable search strategies registered through a strategy-pattern dispatcher (src/core/register.ts): BitapSearch is always available as the default, while ExtendedSearch (src/search/extended) and TokenSearch (src/search/token) are conditionally registered behind build-time env flags (EXTENDED_SEARCH_ENABLED, TOKEN_SEARCH_ENABLED), which is how the same source tree produces the smaller “basic” build alongside the “full” build. The Fuse instance builds a FuseIndex (src/tools/FuseIndex.ts) from the input documents plus a KeyStore for weighted search keys; queries are parsed into an AST by src/core/queryParser.ts (supporting $and/$or composition), scored per field via computeScore.ts for Bitap matches or an inverted index (src/search/token/InvertedIndex.ts) for BM25-style token scoring, and the top-N results are kept efficiently with a MaxHeap (src/tools/MaxHeap.ts) rather than sorting the full result set. src/workers/FuseWorker.ts wraps the same core to shard documents across Web Workers for parallel search.

Tech Stack — Written in TypeScript (40% of the codebase) with the remainder in JavaScript, bundled by tsdown (an esbuild-based bundler, per tsdown.config.ts) into dual ESM/CJS outputs (dist/fuse.mjs, dist/fuse.cjs) plus separate minified “basic” builds. The package ships with zero runtime dependencies — everything in package.json (vitest, eslint 9 + typescript-eslint, prettier, vitepress, husky, commitlint, standard-version) is a devDependency for testing, linting, docs, and release automation. Type-checking runs via tsc against src/tsconfig.json.

Code Quality — The test/ directory holds 20+ spec files covering fuzzy search, extended search, logical search, and token search (further split into scenario, tokenizer, and AND-logic suites), plus dedicated tests for Web Worker behavior, cache invalidation, CJS interop, and even the public TypeScript type surface (package-types.test.ts, typings.test.ts). Snapshot tests under test/__snapshots__/ pin exact result sets for regression safety, run via vitest. Error handling is centralized in src/core/errorMessages.ts as named constants rather than inline strings, and invalid option combinations (e.g. calling Fuse.match() with useTokenSearch) throw explicit, documented errors instead of failing silently.

API Design — Getting started requires only new Fuse(docs, { keys }) followed by .search(query), with sensible defaults in src/core/config.ts covering everything else. Advanced capabilities (weighted keys, extended-search operators, logical queries, token search, Web Worker offloading) are opt-in through boolean options rather than separate APIs, so the mental model stays consistent as usage scales up. Full TypeScript types are re-exported from entry.ts for options, results, and match objects, and the dedicated docs site (fusejs.io, built from the docs/ folder) supplements the README with interactive demos and a complete API reference.

Used by 65 apps in this directory

TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,338

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
98%
MIT

Kimi Code CLI

AI Agents · AI Code Assistants · Developer Tools

7,983

A single-binary, terminal-native coding agent that reads, edits, and runs code end to end, built by Moonshot AI for Kimi models but pluggable with Anthropic, OpenAI, and Google providers too.

View details
83
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
Python
71%
MIT

Langflow

AI Agents · AI Development

155,973

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
64
Dependency
Built with
Python 71%
TypeScript 21%
Updated 6 days ago
TypeScript
97%
Other

Lightdash

Analytics · Data Engineering

6,196

The open-source Looker alternative that turns your dbt project's metrics and dimensions into governed, self-serve charts and dashboards — no license key required.

View details
93
Repo Health
84
Technical
64
Dependency
Built with
TypeScript 97%
Updated 6 days ago
TypeScript
93%
AGPL 3.0

Linkwarden

Bookmarks Archiving · Knowledge Management

20,195

Self-hosted collaborative bookmark manager that captures full-page archives, enables annotation, and keeps your knowledge accessible forever.

View details
90
Repo Health
72
Technical
66
Dependency
Built with
TypeScript 93%
Updated 6 days ago
TypeScript
98%
Other

LobeHub

AI Assistants · Automation · Productivity

83,455

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
65
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
95%
MIT

melty

AI Code Assistants · Code Editors · Developer Tools

5,462

The AI code editor where every chat message is a git commit you can revert, branch, or squash

View details
35
Repo Health
75
Technical
67
Dependency
Built with
TypeScript 95%
Updated 1 years ago
Go
53%
MIT

memos

Note Taking

64,031

Open-source, self-hosted note-taking built for quick capture — Markdown-native, lightweight, and fully yours.

View details
91
Repo Health
78
Technical
65
Dependency
Built with
Go 53%
TypeScript 46%
Updated 6 days ago
Clojure
57%
Other

Metabase

Analytics

49,827

The open-source BI platform that lets anyone ask questions and build dashboards without writing SQL — with an embedded analytics SDK and AI-powered query assistant included.

View details
95
Repo Health
84
Technical
62
Dependency
Built with
Clojure 57%
TypeScript 38%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers