{"id":27611727,"url":"https://github.com/polgubau/fuzzy","last_synced_at":"2026-02-19T06:01:34.801Z","repository":{"id":283078657,"uuid":"950527385","full_name":"PolGubau/fuzzy","owner":"PolGubau","description":"Optimized  library designed with TypeScript from the roots. You just need to type  one command and call one function to get a fuzzy finder for your project.","archived":false,"fork":false,"pushed_at":"2025-04-06T16:14:04.000Z","size":1322,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-21T23:28:47.558Z","etag":null,"topics":["fuzzy","fuzzy-search","library","typescript"],"latest_commit_sha":null,"homepage":"https://fuzzy.polgubau.com","language":"MDX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolGubau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-18T09:53:59.000Z","updated_at":"2025-09-30T07:30:01.000Z","dependencies_parsed_at":"2025-03-18T13:32:09.034Z","dependency_job_id":"6c107d84-fa15-467e-a548-d07ffc544a39","html_url":"https://github.com/PolGubau/fuzzy","commit_stats":null,"previous_names":["polgubau/fuzzy"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/PolGubau/fuzzy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolGubau%2Ffuzzy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolGubau%2Ffuzzy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolGubau%2Ffuzzy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolGubau%2Ffuzzy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolGubau","download_url":"https://codeload.github.com/PolGubau/fuzzy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolGubau%2Ffuzzy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29604552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T05:11:50.834Z","status":"ssl_error","status_checked_at":"2026-02-19T05:11:38.921Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fuzzy","fuzzy-search","library","typescript"],"created_at":"2025-04-23T00:41:55.046Z","updated_at":"2026-02-19T06:01:34.780Z","avatar_url":"https://github.com/PolGubau.png","language":"MDX","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Branches](./badges/packages/fuzzy/coverage-branches.svg)\n![Functions](./badges/packages/fuzzy/coverage-functions.svg)\n![Lines](./badges/packages/fuzzy/coverage-lines.svg)\n![Statements](./badges/packages/fuzzy/coverage-statements.svg)\n![Coverage total](./badges/packages/fuzzy/coverage-total.svg)\n\n![Last commit](https://img.shields.io/github/last-commit/PolGubau/fuzzy?logo=git)\n![Last Update](https://img.shields.io/npm/last-update/%40polgubau%2Ffuzzy?logo=npm\u0026label=last%20update)\n![Version](https://img.shields.io/npm/v/%40polgubau%2Ffuzzy?logo=npm\u0026label=version)\n![License](https://img.shields.io/github/license/PolGubau/fuzzy?logo=github\u0026label=license)\n![Downloads](https://img.shields.io/npm/dt/%40polgubau%2Ffuzzy?logo=npm\u0026label=downloads)\n[![Formatted with Biome](https://img.shields.io/badge/Formatted_with-Biome-60a5fa?style=flat\u0026logo=biome)](https://biomejs.dev/)\n\n# @polgubau/fuzzy 🔍\n**@polgubau/fuzzy** is an optimized fuzzy finder library designed with TypeScript from the roots. You just need to type one command and call one function to get a fuzzy finder for your project.\n \n## What and why\nFilters in JavaScript are often slow and cumbersome. The native `Array.prototype.filter` method is not optimized for performance, especially when dealing with large datasets. This library provides a simple and efficient way to perform fuzzy searches on arrays of strings.\n\nIt allows you to create a fuzzy search function that can be reused across your application, making it easy to filter lists based on user input.\n\n\n### What this is NOT ⚠️\n- A catch-all library that solves every problem.\n- A replacement for Lodash or Underscore.\n- A package that will unnecessarily inflate your bundle size.\n\n### What this IS ✅\n- A collection of small, focused utility functions.\n- Modular, tree-shakable and lightweight both for CJS and ESM.\n- Designed to be simple, efficient, and easy to use.\n- Fully typed, with TypeScript definitions included.\n\n## Installation\n\nInstall the library using your package manager of choice:\n\n```sh\npnpm add @polgubau/fuzzy\n```\n\n## Usage\n\n```ts\nimport fuzzy from '@polgubau/fuzzy';\n\nconst list = [\"volvo\", \"seat\", \"mercedes\", \"audi\", \"bmw\"];\nconst queryText = \"volv\"; // The search term\nconst fuzzySearch = fuzzy(list);\n\n// Run this whenever the search term changes\nconst fuzzedList = fuzzySearch(queryText);\nconsole.log(fuzzedList); \n```\n## Framework adapters\nThe library core is available as a standalone package, but we also provide adapters for popular frameworks like React and Vue.\n\n\u003e Notice how the core import is `@polgubau/fuzzy`, while the React and Vue adapters are imported from `@polgubau/fuzzy/react` and `@polgubau/fuzzy/vue` respectively.\n\nUsing this import will allow you to use the library in a framework-agnostic way, while the framework-specific imports will provide additional functionality tailored to that framework. So you don't import vue or react bundles if you don't need them. \n\n### Using React? \nTo simplify the integration of fuzzy search into your React applications, we provide a custom hook called `useFuzzy`.\n\n```tsx title=\"App.tsx\"\nimport { useFuzzy, Highlight } from '@polgubau/fuzzy/react' // Note: now importing from /react\n\nconst filteredList = useFuzzy({\n  list: [\"volvo\", \"seat\", \"mercedes\", \"audi\", \"bmw\"],\n  query: \"volv\"\n})\n\nfilteredList.map(({ item, matches: [range] }) =\u003e (\n  \u003cdiv key={item}\u003e\n    \u003cHighlight text={item} ranges={range} /\u003e\n  \u003c/div\u003e\n))\n```\n\n### Using Vue?\nThe same approach is available for Vue applications. We provide a composable called `useFuzzy` to simplify the integration of fuzzy search into your Vue applications.\n\n```vue title=\"App.vue\"\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cinput v-model=\"query\" placeholder=\"Search...\" /\u003e\n    \u003cul\u003e\n      \u003cli v-for=\"(result, index) in fuzzySearch.results\" :key=\"index\"\u003e\n        {{ result }}\n      \u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n \n\u003cscript lang=\"ts\"\u003e\nimport { ref } from \"vue\";\nimport { useFuzzy } from \"@polgubau/fuzzy/vue\";\n \nexport default {\n  setup() {\n    // Lista de strings para la búsqueda\n    const items = ref\u003cstring[]\u003e([\"Apple\", \"Banana\", \"Cherry\", \"Grape\", \"Pineapple\"]);\n    const query = ref(\"\");\n \n    // Using the composable\n    const fuzzySearch = useFuzzy({ list: items, query });\n \n    return {\n      query,\n      fuzzySearch,\n    };\n  },\n};\n\u003c/script\u003e\n```\n## Documentation\nThe documentation page is available at [fuzzy.polgubau.com](https://fuzzy.polgubau.com).\n\nThe documentation is built using [Fumadocs](https://fumadocs.com) with some customizations.\n\n### I18n support\n\nThe documentation is available in multiple languages. You can switch between them using the language selector in the top right corner of the page.\nCurrently, the following languages are supported:\n\n| Language | Supported |\n| -------- | --------- |\n| English  | ✅       |\n| Spanish  | ✅       |\n| Catalan  | ✅       |\n| German   | ✅       |\n\n\n\n## 🛠 Development\n\n### Building the project\n\nThe easiest way to work with the project monorepo is to run\n\n```sh\npnpm dev\n```\nin the root directory. This will start a watch build for the package and start a local server to preview the documentation page.\n\n### Running tests\n\u003e **Note:** The tests are written in TypeScript and use [Vitest](https://vitest.dev/) as the testing framework.\nRun the command inside the `packages/fuzzy` directory to run the tests.\n```sh\npnpm test\n```\n\n\n---\n## Author and license\nMade with ❤️ by [Pol Gubau Amores](https://polgubau.com)\n\nThis project is based on *microfuzz*, which was created by [@Nozbe](https://github.com/Nozbe), some improvements were made to the original code, and it was rewritten in TypeScript.\n\n[See all contributors](https://github.com/PolGubau/fuzzy/graphs/contributors).\n\nThis project is available under the MIT license. See the [LICENSE file](https://github.com/PolGubau/fuzzy/LICENSE) for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolgubau%2Ffuzzy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolgubau%2Ffuzzy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolgubau%2Ffuzzy/lists"}