[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3160":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},3160,"Fuse","krisk\u002FFuse","krisk","Lightweight fuzzy-search, in JavaScript","https:\u002F\u002Ffusejs.io\u002F",null,"JavaScript",20325,808,131,3,0,11,83,1,43.72,"Apache License 2.0",false,"main",true,[26,27,28,29],"bitap","javascript","lightweight-fuzzy-search","weighted-search","2026-06-12 02:00:46","# Fuse.js\n\n![Node.js CI](https:\u002F\u002Fgithub.com\u002Fkrisk\u002FFuse\u002Fworkflows\u002FNode.js%20CI\u002Fbadge.svg)\n[![Version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Ffuse.js.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Ffuse.js)\n[![Downloads](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Ffuse.js.svg)](https:\u002F\u002Fnpmcharts.com\u002Fcompare\u002Ffuse.js?minimal=tru)\n[![code style: prettier](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcode_style-prettier-ff69b4.svg?style=flat-square)](https:\u002F\u002Fgithub.com\u002Fprettier\u002Fprettier)\n[![Contributors](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fcontributors\u002Fkrisk\u002Ffuse.svg)](https:\u002F\u002Fgithub.com\u002Fkrisk\u002FFuse\u002Fgraphs\u002Fcontributors)\n![License](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fl\u002Ffuse.js.svg)\n\nFuse.js is a lightweight, zero-dependency fuzzy-search library written in TypeScript. It works in the browser and on the server, and is designed for searching small-to-medium datasets on the client side where you can't rely on a dedicated search backend.\n\n## ✨ What's New: Token Search\n\nMulti-word fuzzy search with relevance ranking. Type `\"javascrpt paterns\"` and find `\"JavaScript Patterns\"` — typo tolerance, multiple words, and smart ranking all at once.\n\n```js\nconst fuse = new Fuse(docs, {\n  useTokenSearch: true,\n  keys: ['title', 'author', 'description']\n})\n\nfuse.search('javascrpt paterns')\n\u002F\u002F → [{ item: { title: 'JavaScript Patterns', ... } }]\n```\n\nSee [Token Search](#token-search) below for details.\n\n## 🧪 Beta: Web Workers\n\nSearch large datasets without freezing the UI. `FuseWorker` splits your data across multiple Web Workers and searches in parallel — ~5x faster on 100K documents.\n\n```js\nimport { FuseWorker } from 'fuse.js\u002Fworker'\n\nconst fuse = new FuseWorker(docs, {\n  keys: ['title', 'author', 'description']\n})\n\nconst results = await fuse.search('query')\nfuse.terminate()\n```\n\nSame options and results as `Fuse` — just async. Function-valued options (`sortFn`, `getFn`, `keys[].getFn`) aren't supported because functions can't be transferred to a worker; everything else carries over. See the [Web Workers docs](https:\u002F\u002Ffusejs.io\u002Fweb-workers.html) for the interactive demo and full API.\n\n## Installation\n\n```bash\nnpm install fuse.js\n```\n\n```bash\nyarn add fuse.js\n```\n\nOr include directly via CDN:\n\n```html\n\u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Ffuse.js\u002Fdist\u002Ffuse.min.mjs\">\u003C\u002Fscript>\n```\n\n## Quick Start\n\n```js\nimport Fuse from 'fuse.js'\n\nconst books = [\n  { title: \"Old Man's War\", author: 'John Scalzi' },\n  { title: 'The Lock Artist', author: 'Steve Hamilton' },\n  { title: 'HTML5', author: 'Remy Sharp' },\n  { title: 'JavaScript: The Good Parts', author: 'Douglas Crockford' }\n]\n\nconst fuse = new Fuse(books, {\n  keys: ['title', 'author']\n})\n\nfuse.search('javscript')\n\u002F\u002F → [{ item: { title: 'JavaScript: The Good Parts', ... }, ... }]\n```\n\n## Features\n\n### Fuzzy Search\n\nThe core of Fuse.js. Uses the [Bitap algorithm](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBitap_algorithm) for approximate string matching — handles typos, misspellings, and partial matches out of the box.\n\n```js\nfuse.search('javscript')\n\u002F\u002F → [{ item: { title: 'JavaScript: The Good Parts', author: 'Douglas Crockford' } }]\n```\n\n### Weighted Keys\n\nSearch across multiple fields with different importance levels. Title matches can rank higher than description matches.\n\n```js\nconst fuse = new Fuse(docs, {\n  keys: [\n    { name: 'title', weight: 2 },\n    { name: 'description', weight: 1 }\n  ]\n})\n```\n\n### Extended Search\n\nUse operators for precise control: exact match (`=`), prefix (`^`), suffix (`!`), and more. Enable with `useExtendedSearch: true`.\n\n```js\nconst fuse = new Fuse(list, {\n  useExtendedSearch: true,\n  keys: ['title']\n})\n\nfuse.search('=exact match')   \u002F\u002F exact match\nfuse.search('^prefix')        \u002F\u002F starts with\nfuse.search('!term')          \u002F\u002F does not include\n```\n\n### Token Search\n\nSplits multi-word queries into individual terms, fuzzy-matches each independently, and ranks results using BM25-style IDF weighting. Enable with `useTokenSearch: true`.\n\n```js\nconst fuse = new Fuse(docs, {\n  useTokenSearch: true,\n  keys: ['title', 'body']\n})\n\nfuse.search('express midleware rout')\n\u002F\u002F Finds \"Express Middleware\" and \"Express Routing Guide\" despite typos\n```\n\n- **Typo tolerance per word** — each term is fuzzy-matched independently\n- **Relevance ranking** — rare terms are weighted higher than common ones\n- **Word order independent** — `\"patterns javascript\"` and `\"javascript patterns\"` return identical results\n- **No query length limit** — long multi-word queries work naturally since each term is searched separately\n\nAvailable in the full build. See [TOKEN_SEARCH.md](TOKEN_SEARCH.md) for details and performance benchmarks.\n\n### Logical Search\n\nCombine conditions with `$and` and `$or` for complex queries. Available in the full build.\n\n```js\nfuse.search({\n  $and: [\n    { title: 'javascript' },\n    { author: 'crockford' }\n  ]\n})\n```\n\n### Match Highlighting\n\nGet character-level match indices for highlighting search results in your UI.\n\n```js\nconst fuse = new Fuse(list, {\n  includeMatches: true,\n  keys: ['title']\n})\n\nconst result = fuse.search('javscript')\n\u002F\u002F result[0].matches[0].indices → [[0, 9]]\n```\n\n### Single String Matching\n\nUse `Fuse.match()` to fuzzy-match a pattern against a single string without creating an index. Useful for one-off comparisons or custom filtering.\n\n```js\nconst result = Fuse.match('javscript', 'JavaScript: The Good Parts')\n\u002F\u002F → { isMatch: true, score: 0.04, indices: [[0, 9]] }\n```\n\n`Fuse.match()` does **not** support `useTokenSearch` — token search requires corpus-level statistics (`df`, `fieldCount`) that a one-off string comparison can't provide. Passing `useTokenSearch: true` throws an explicit error. Use `new Fuse(docs, { useTokenSearch: true }).search(query)` for token-search behavior.\n\n### Dynamic Collections\n\nAdd and remove documents from a live index without rebuilding.\n\n```js\nfuse.add({ title: 'New Book', author: 'New Author' })\nfuse.remove((doc) => doc.title === 'Old Book')\n```\n\n## Builds\n\nFuse.js ships in two variants:\n\n| Build | Includes | Min + gzip |\n|---|---|---|\n| **Full** | Fuzzy + Extended + Logical + Token search | ~8 kB |\n| **Basic** | Fuzzy search only | ~6.5 kB |\n\nUse the basic build if you only need fuzzy search and want the smallest bundle size.\n\n## Documentation\n\nFor the full API reference, configuration options, scoring theory, and interactive demos, visit **[fusejs.io](https:\u002F\u002Ffusejs.io)**.\n\n## Supporting Fuse.js\n\n- [Become a backer or sponsor on **GitHub**](https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fkrisk)\n- [Become a backer or sponsor on **Patreon**](https:\u002F\u002Fpatreon.com\u002Ffusejs)\n- [One-time donation via **PayPal**](https:\u002F\u002Fwww.paypal.me\u002Fkirorisk)\n\n## Develop\n\nSee [DEVELOPERS.md](DEVELOPERS.md) for setup, scripts, and project structure.\n\n## Contribute\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on issues and pull requests.\n","Fuse.js 是一个轻量级的模糊搜索库，使用 TypeScript 编写且无任何依赖。其核心功能包括基于 Bitap 算法的模糊匹配，支持拼写错误、错别字和部分匹配，并具有智能排名机制。最新版本引入了 Token Search 功能，实现了多词模糊搜索与相关性排序。此外，还提供了实验性的 Web Workers 支持，能够处理大规模数据集而不阻塞用户界面。适用于需要在客户端进行高效搜索但又无法依赖专用后端服务的小到中型数据集场景。",2,"2026-06-11 02:52:42","top_language"]