{"id":17341125,"url":"https://github.com/tanhauhau/levenary","last_synced_at":"2025-05-08T23:43:54.612Z","repository":{"id":36753321,"uuid":"228944564","full_name":"tanhauhau/levenary","owner":"tanhauhau","description":"Find the shortest Levenshtein distance in the array","archived":false,"fork":false,"pushed_at":"2023-01-05T03:18:05.000Z","size":172,"stargazers_count":24,"open_issues_count":13,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T23:43:48.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/tanhauhau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"tanhauhau"}},"created_at":"2019-12-19T00:32:35.000Z","updated_at":"2024-09-10T04:52:33.000Z","dependencies_parsed_at":"2023-01-17T04:32:27.973Z","dependency_job_id":null,"html_url":"https://github.com/tanhauhau/levenary","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhauhau%2Flevenary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhauhau%2Flevenary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhauhau%2Flevenary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanhauhau%2Flevenary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanhauhau","download_url":"https://codeload.github.com/tanhauhau/levenary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166474,"owners_count":21864467,"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-10-15T15:47:53.722Z","updated_at":"2025-05-08T23:43:54.597Z","avatar_url":"https://github.com/tanhauhau.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tanhauhau"],"categories":[],"sub_categories":[],"readme":"# levenary\n\n[![npm-version](https://img.shields.io/npm/v/levenary.svg)](https://www.npmjs.com/package/levenary)\n[![github-actions](https://github.com/tanhauhau/levenary/workflows/CI/badge.svg)](https://github.com/tanhauhau/levenary/actions)\n\n\u003e Given a string, A and an array of strings XS, return the string X from XS whose Levenshtein distance from A is minimal.\n\n\n## Install\n\n```\n$ npm install levenary\n```\n\n\n## Usage\n\n```js\nimport levenary from 'levenary';\n\nlevenary('cat', ['cow', 'dog', 'pig']);\n//=\u003e 'cow'\n```\n\n## Why `levenary`?\n1. Based on [leven](https://github.com/sindresorhus/leven), the fastest JS implementation of the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance)\n1. Only 1 API. Simple and clean. If you want more, please use [didyoumean2](https://www.npmjs.com/package/didyoumean2).\n1. [Flow](http://flow.org/) and [TypeScript](http://typescriptlang.org/) support.\n\n## Benchmark\n\n```\n$ npm run bench\n```\n\n```\n  311,915 op/s » levenary\n   74,030 op/s » didyoumean\n  141,423 op/s » didyoumean2\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanhauhau%2Flevenary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanhauhau%2Flevenary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanhauhau%2Flevenary/lists"}