{"id":21701620,"url":"https://github.com/flintinatux/fuzzy-wuzzy","last_synced_at":"2026-04-10T23:45:26.471Z","repository":{"id":148663565,"uuid":"184928170","full_name":"flintinatux/fuzzy-wuzzy","owner":"flintinatux","description":"Example React app for exploring client-side fuzzy-search and the new useReducer hook","archived":false,"fork":false,"pushed_at":"2019-05-08T04:10:53.000Z","size":801,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-19T05:02:49.820Z","etag":null,"topics":["fuzzy-search","javascript","react","scss","usereducer"],"latest_commit_sha":null,"homepage":"https://flintinatux.github.io/fuzzy-wuzzy/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flintinatux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-05-04T18:00:49.000Z","updated_at":"2019-11-06T15:53:56.000Z","dependencies_parsed_at":"2023-05-20T19:30:22.780Z","dependency_job_id":null,"html_url":"https://github.com/flintinatux/fuzzy-wuzzy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flintinatux/fuzzy-wuzzy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flintinatux%2Ffuzzy-wuzzy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flintinatux%2Ffuzzy-wuzzy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flintinatux%2Ffuzzy-wuzzy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flintinatux%2Ffuzzy-wuzzy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flintinatux","download_url":"https://codeload.github.com/flintinatux/fuzzy-wuzzy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flintinatux%2Ffuzzy-wuzzy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260690823,"owners_count":23047097,"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":["fuzzy-search","javascript","react","scss","usereducer"],"created_at":"2024-11-25T20:24:52.555Z","updated_at":"2026-04-10T23:45:21.429Z","avatar_url":"https://github.com/flintinatux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fuzzy-wuzzy\n\nI wanted to try my hand at client-side fuzzy-searching and React's [`useReducer`](https://devdocs.io/react/hooks-reference#usereducer), so I put together this demo app over the weekend.\n\nThe app is a fictitious list of users' names and addresses.  The sample data I found [here](https://www.briandunning.com/sample-data/) and converted from CSV to JSON to simulate a backend API.  Feel free to try out the hosted version at the link below:\n\nhttps://flintinatux.github.io/fuzzy-wuzzy\n\nYou can search across every field in the table, and it should be forgiving of case and typos.  Here are some example searches:\n\n- `NY`\n- `Harris`\n- `south`\n- `sourh`\n- `Donna`\n- `middle`\n\nYou can also paginate through the results using the buttons at the top-right.\n\n## What I learned\n\n### ... about fuzzy-search\n\nSince I wanted to search across all fields from the same input, my first stab at the fuzzy-search involved concatenating all the fields into a new field on which to search.  That yielded poor results, though, most likely because of the [`string-score`](https://github.com/knpwrs/string-score) algorithm I'm using.\n\nSo I switched to scoring every field on a given record, and then taking the max of all those scores.  This gives much better results, and while it is obviously less efficient - `O(n^2)` instead of `O(n)` - I haven't noticed any lag in the browser with only 500 records to search through.\n\n**Note:** This will not work for large datasets, which I'll say might start on the order of 10,000 records.  I know from previous experience that the browser gets a little laggy iterating through a list that large.  So if that's your usecase, this won't be a good fit, and you should stick with a server-side search.  But many datasets are small enough to merit the near-instant speed of client-side searching.\n\n### ... about `useReducer`\n\nThe best I can say is... it works?  It's a stripped down version of the real [`redux`](https://redux.js.org/), available as a hook.  No middleware or dev tools are supported, the latter of which I missed the most for this app.  I ended up pulling in [`reinspect`](https://github.com/troch/reinspect) to backfill support for dev tools, but at that point I've already added enough dependencies to merit using `redux` after all.\n\nSo maybe it's nice for some really small stand-alone components, but even with an app as small as this, it still felt limiting.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflintinatux%2Ffuzzy-wuzzy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflintinatux%2Ffuzzy-wuzzy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflintinatux%2Ffuzzy-wuzzy/lists"}