{"id":13515326,"url":"https://github.com/bevacqua/fuzzysearch","last_synced_at":"2025-05-14T04:07:27.801Z","repository":{"id":28119060,"uuid":"31618003","full_name":"bevacqua/fuzzysearch","owner":"bevacqua","description":":crystal_ball: Tiny and blazing-fast fuzzy search in JavaScript","archived":false,"fork":false,"pushed_at":"2023-05-31T04:51:39.000Z","size":15,"stargazers_count":2726,"open_issues_count":5,"forks_count":86,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-05-06T03:38:46.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ponyfoo.com","language":"JavaScript","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/bevacqua.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2015-03-03T19:52:53.000Z","updated_at":"2025-04-20T00:24:39.000Z","dependencies_parsed_at":"2023-10-20T18:13:10.037Z","dependency_job_id":"33539b19-5c02-48e5-9a90-51539c2029e0","html_url":"https://github.com/bevacqua/fuzzysearch","commit_stats":{"total_commits":17,"total_committers":4,"mean_commits":4.25,"dds":0.4117647058823529,"last_synced_commit":"9873ea0546a47f5d96e037ff02b78b871c809d62"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevacqua%2Ffuzzysearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevacqua%2Ffuzzysearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevacqua%2Ffuzzysearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevacqua%2Ffuzzysearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bevacqua","download_url":"https://codeload.github.com/bevacqua/fuzzysearch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870869,"owners_count":21976613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T05:01:09.515Z","updated_at":"2025-05-14T04:07:27.775Z","avatar_url":"https://github.com/bevacqua.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Javascript","Utilities","Search","Text Search"],"sub_categories":["Surveys","Fuzzy search"],"readme":"# fuzzysearch\n\n\u003e Tiny and blazing-fast fuzzy search in JavaScript\n\nFuzzy searching allows for flexibly matching a string with partial input, useful for filtering data very quickly based on lightweight user input.\n\n# Demo\n\nTo see `fuzzysearch` in action, head over to [bevacqua.github.io/horsey][3], which is a demo of an autocomplete component that uses `fuzzysearch` to filter out results based on user input.\n\n# Install\n\nFrom `npm`\n\n```shell\nnpm install --save fuzzysearch\n```\n\n# `fuzzysearch(needle, haystack)`\n\nReturns `true` if `needle` matches `haystack` using a fuzzy-searching algorithm. Note that this program doesn't implement _[levenshtein distance][2]_, but rather a simplified version where **there's no approximation**. The method will return `true` only if each character in the `needle` can be found in the `haystack` and occurs after the preceding matches.\n\n```js\nfuzzysearch('twl', 'cartwheel') // \u003c- true\nfuzzysearch('cart', 'cartwheel') // \u003c- true\nfuzzysearch('cw', 'cartwheel') // \u003c- true\nfuzzysearch('ee', 'cartwheel') // \u003c- true\nfuzzysearch('art', 'cartwheel') // \u003c- true\nfuzzysearch('eeel', 'cartwheel') // \u003c- false\nfuzzysearch('dog', 'cartwheel') // \u003c- false\n```\n\nAn exciting application for this kind of algorithm is to filter options from an autocomplete menu, check out [horsey][3] for an example on how that might look like.\n\n# But! _`RegExp`s...!_\n\n[![chart showing abysmal performance for regexp-based implementation][1]][4]\n\n\u003csub\u003eThe current implementation uses the algorithm suggested by Mr. Aleph, a crazy russian compiler engineer working at V8.\u003c/sub\u003e\n\n# License\n\nMIT\n\n[1]: https://cloud.githubusercontent.com/assets/934293/6550014/d3a86174-c5fc-11e4-8334-b2e2b0d38fad.png\n[2]: http://en.wikipedia.org/wiki/Levenshtein_distance\n[3]: http://bevacqua.github.io/horsey\n[4]: http://jsperf.com/fuzzysearch-regex/14\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevacqua%2Ffuzzysearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbevacqua%2Ffuzzysearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevacqua%2Ffuzzysearch/lists"}