| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
High-performance fuzzy file search with intelligent ranking algorithm
Zero-dependency fuzzy matching engine optimized for lightning-fast file path searches. Uses bit-mask pre-filtering and intelligent scoring to deliver sub-millisecond results on massive file lists.
Deno (JSR)
deno add jsr:@neabyte/fuzzy-findernpm/Node.js
npm install @neabyte/fuzzy-finderCDN (Browser/ESM)
// esm.sh
import FuzzyFinder from 'https://esm.sh/jsr/@neabyte/fuzzy-finder'
// or unpkg (npm mirror)
import FuzzyFinder from 'https://unpkg.com/@neabyte/fuzzy-finder@latest/src/index.ts'// Default import (works in Deno, Node.js, and browsers)
import FuzzyFinder from '@neabyte/fuzzy-finder'
// or named export
import { FuzzyFinder, type SearchResult } from '@neabyte/fuzzy-finder'// Initialize
const finder = new FuzzyFinder()
// Load file paths (sync)
finder.load([
'src/index.ts',
'src/utils/helpers.ts',
'src/components/Button.tsx',
'tests/index.test.ts'
])
// Search with fuzzy matching
const results = finder.search('idx', 5)
// [{ path: 'src/index.ts', score: 0.98 }, ...]const finder = new FuzzyFinder()
// Load 100k+ files without blocking UI
const { queryable, done } = finder.loadAsync(massiveFileList)
// Wait for first chunk (queryable)
await queryable
// Search while still indexing
const results = finder.search('component', 10)
// Wait for complete indexing
await doneconst results = finder.search('btn', 5, { includePositions: true })
// [{
// path: 'src/components/Button.tsx',
// score: 0.95,
// positions: [17, 21, 25] // Character indices of 'b', 't', 'n'
// }]// Uppercase in query triggers case-sensitive mode
const results = finder.search('Button', 5) // Case-sensitive
const results = finder.search('button', 5) // Case-insensitiveFrom the repo root (requires Deno).
Check - format, lint, and typecheck:
# Format, lint, and typecheck source
deno task checkTest - run tests:
# Run tests in tests/
deno task testFuzzy Finder implements bit-mask accelerated fuzzy matching inspired by command palette search in editors like VS Code and Sublime Text. It pre-filters paths using 26-bit character bitmaps (one bit per a-z letter), skipping paths that cannot possibly match before running the full fuzzy algorithm.
Common use cases:
See full documentation for advanced usage including:
This project is licensed under the MIT license. See LICENSE for details.
| Back | FazBrowse Home | New Git URL |