Skip to content
CAI
Software that uses CAICheck a score

krisk/Fuse

66.4

Adequate · 1 October 2026

8.3k

lines of production code

TypeScript

with JavaScript

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Fuse.js is a fuzzy search library that enables pattern matching and complex filtering across datasets using a MongoDB-style object query syntax and token-based scoring. It supports parallel search execution via Web Workers for improved performance on large collections and provides static methods for single-string matching. The system includes comprehensive benchmarking tools to evaluate search speed and memory usage, alongside a modernized TypeScript codebase with strict type safety and automated release workflows.

How it got here

2012–2019 — v7.6.0 beta release and modernization

5 changes.

This period focused on the development and release of Fuse.js v7.6.0-beta.0, introducing a MongoDB-style object query syntax and migrating the codebase to TypeScript. The update also modernized the build toolchain by switching to tsdown and adding ESM support, while implementing Web Worker capabilities for parallel search and lighter-weight build variants.

2020–2026 — TypeScript rewrite and feature expansion

12 changes.

The project underwent a comprehensive rewrite from JavaScript to TypeScript, introducing token-based search with IDF scoring, MongoDB-style object queries, and parallel search via Web Workers. This period also included significant improvements to search accuracy, diacritic handling, and the addition of automated release and documentation deployment scripts.

Features

Add token-based search with IDF scoring and customizable Unicode-aware tokenization

Introduces a new token search mode that performs per-term fuzzy matching using an inverted index with IDF (Inverse Document Frequency) weighting for improved relevance. Users can enable this via the \useTokenSearch\ option and control matching logic with \tokenMatch\ ('any' for OR, 'all' for AND). The feature includes a customizable tokenizer with a Unicode-aware default that handles diacritics and combining marks correctly, and supports case sensitivity and diacritic stripping options. The implementation includes an inverted index that correctly tracks document frequency and field counts, supporting dynamic addition and removal of documents with proper index renumbering.

src/search/token · high confidence

Core search engine rewritten in TypeScript with token search and MongoDB-style query support

The core search engine has been rewritten from JavaScript to TypeScript, introducing several significant capability and behavior changes. Users can now enable token-based fuzzy matching (per-term fuzzy matching with IDF scoring) via the \useTokenSearch\ option, which builds an inverted index for faster, corpus-aware searches. The engine also supports a new MongoDB-style object query syntax (e.g., \{ name: { $eq: 'John' } }\) for precise field-level filtering, accessible via \Fuse.parseQuery\ or extended search. Additionally, a new static \Fuse.match()\ method allows single-string pattern matching without instantiating a full Fuse instance. The default configuration is now frozen to prevent accidental mutation across instances, and scoring logic has been refined to correctly handle key weights and tie-breaking. Note that token search is not supported in Web Workers due to corpus-level statistics requirements, and the \removeAt()\ method now returns the removed item.

src/core · high confidence

Extended search rewritten in TypeScript with MongoDB-style object query support

The extended search module has been rewritten from JavaScript to TypeScript and refactored to use plain functions instead of matcher classes, improving maintainability and type safety. This change introduces a new MongoDB-style object query syntax (e.g., using $and, $or, $not, and operators like $contains, $prefix, $suffix) alongside the existing string-based pattern syntax, allowing users to construct complex search queries programmatically. The implementation ensures parity between string and object queries by compiling object queries into the same internal matcher structure, supporting features like inverse patterns, escaped pipes, and quoted tokens with inner spaces.

src/search/extended · high confidence

Fuse.js v7.6.0-beta.0 distributed with Web Worker support and basic build variants

The distribution now includes \FuseWorker\ (in \fuse-worker.cjs\, \fuse-worker.mjs\, and corresponding TypeScript declarations), enabling parallel search across multiple Web Workers by sharding documents and merging results. The \FuseWorker\ constructor validates that function-valued options (\sortFn\, \getFn\, \tokenize\) are not used, as they cannot be transferred to workers, and explicitly rejects \useTokenSearch\ because token-level statistics require corpus-wide context. Additionally, \fuse.basic.cjs\ and \fuse.basic.min.cjs\ are provided as lighter-weight bundles that exclude extended, logical, and token search capabilities, throwing errors if those features are attempted.

dist · high confidence

Fuse.js v7.6.0-beta.0 introduces MongoDB-style object query syntax

Users can now express search conditions using a structured object syntax (e.g., \{ title: { $startsWith: 'old' } }\) instead of the previous string-based operators (like \^old\). This new syntax removes the need for the \useExtendedSearch\ flag, provides TypeScript autocompletion, and handles escaping more naturally. The entry also reflects the project's migration to a TypeScript codebase, the adoption of the \tsdown\ bundler, and the addition of configuration files for Prettier, ESLint, and Vitest.

(repo-wide) · high confidence

New release and documentation deployment scripts

Added three new shell and Node.js scripts to streamline the release and documentation workflows. The \release.sh\ script automates library publishing using \standard-version\, prompting for confirmation before executing. The \deploy-docs.sh\ script handles building and publishing the documentation site to the \gh-pages\ branch, including a new \--yes\ flag to support non-interactive CI/CD pipelines. Additionally, \bump-docs.cjs\ ensures documentation version references are updated to match the current package version from \package.json\, preventing version lag during the release process.

scripts · high confidence

Parallel search via Web Workers

Users can now perform search operations in parallel using Web Workers to improve performance on large datasets. The new \FuseWorker\ class manages a pool of worker threads, automatically detecting the number of available CPU cores to determine the optimal worker count. This feature supports the existing search capabilities, including MongoDB-style object queries and customizable tokenizers, but explicitly rejects options that cannot be serialized across worker boundaries, such as function-valued options (e.g., \sortFn\, \getFn\, \tokenize\) and the \useTokenSearch\ mode, which requires global corpus statistics that are not currently supported in the parallelized environment.

src/workers · high confidence

Behavioural changes

Improved diacritic handling and BigInt support in search helpers

The search helper functions now correctly handle non-decomposable diacritics (such as ł, ø, ß) that were previously ignored by standard normalization, ensuring more accurate text matching. Additionally, the \get\ helper and type utilities have been updated to support BigInt values, allowing these types to be properly traversed and converted to strings during search operations.

src/helpers · high confidence

Rewrite to TypeScript with new static match and token search capabilities

The library source has been rewritten from JavaScript to TypeScript, introducing a static Fuse.match() method for single-string matching that explicitly rejects token search to prevent runtime errors, and adding support for token-based fuzzy matching with customizable tokenizers and IDF scoring. This update also enables MongoDB-style object query syntax and keyless string entries in logical queries, while integrating these features via build-time flags (EXTENDED\_SEARCH\_ENABLED, TOKEN\_SEARCH\_ENABLED) and re-exporting comprehensive TypeScript types for consumers.

src · high confidence

Rewritten Bitap search engine with TypeScript and improved match accuracy

The Bitap search implementation has been rewritten in TypeScript and restructured into modular files (computeScore, convertMaskToIndices, etc.). This change introduces a fix for highlight indices: they are now restricted to the actual matched window rather than marking all visited characters, ensuring that only the relevant portion of the text is highlighted. Additionally, the exact-match shortcut now correctly respects the \minMatchCharLength\ configuration, preventing short strings from matching when they should be ignored. The search logic also reuses bit arrays to improve performance.

src/search/bitap · high confidence

Updated Husky configuration to v8 with npm-based hooks

The project's pre-commit and commit-msg hooks have been rewritten to align with Husky v8, switching from the previous yarn-based setup to npm. The pre-commit hook now executes tests via 'npm test', and the commit-msg hook runs commitlint using 'npx', ensuring consistent execution across the npm ecosystem.

.husky · high confidence

Fixes

Rewrite search indexing and normalization tools in TypeScript with improved word counting

The core search indexing components (FuseIndex, KeyStore, MaxHeap) and field normalization logic have been rewritten from JavaScript to TypeScript, introducing stricter type safety and internal refactoring. A key behavioral improvement is in field normalization: word counting now explicitly handles tabs, newlines, and carriage returns as separators (previously only spaces were reliably detected), and uses a loop-based transition counter instead of regex for better performance and accuracy. Additionally, the index now safely coerces non-string array values to strings during indexing and guards against crashes on empty strings, while the MaxHeap ensures correct top-N selection even when search scores tie.

src/tools · high confidence

Test coverage

Added Vitest snapshot tests for search functionality; Added benchmark suite for search performance and index structure analysis; Added comprehensive test suite for Fuse.js v4 features and fixes; Added test fixtures for books and Pokémon data.

Dependencies

Fuse.js 7.6.0-beta.0 release with ESM exports and security overrides

This release updates the Fuse.js package to version 7.6.0-beta.0, introducing proper ESM exports via the \exports\ field in \package.json\ to support both CommonJS and ES Module consumers. The build toolchain has been modernized by switching from Rollup to \tsdown\ (v0.22.1) and upgrading TypeScript to v6, Vitest to v4, and ESLint to v9. Additionally, the project pins secure versions for \serialize-javascript\, \esbuild\, \fast-uri\, and \vite\ via npm overrides to address known security vulnerabilities.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 62 → 66 (+4.4)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 82 → 82 (+0.0)
  • Architecture 98 → 97 (-0.5)
  • Maturity 66 → 66 (+0.1)
  • Readiness 61 → 61 (+0.6)
  • Security 57 → 71 (+13.9)
  • Accessibility 69 → 69 (+0.0)
  • Performance 100 (new)

Resolved (7)

  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
  • Documentation: contradicts the code (docs/public/team-plans.html)
  • Documentation: no usage examples (docs/demo.md)
  • Documentation: written for insiders
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • Hotspot: src/core/index.ts (src/core/index.ts)

New (6)

  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (the committed lockfile resolved no direct production dependency)
  • Documentation: other issue (docs/public/donate.html)
  • Documentation: other issue (docs/public/robots.txt)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • Medium: security finding (details withheld)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

krisk/Fuse was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit edf2fb608eca0461508d1d71317e6e58309ffada — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.