{"id":32255059,"url":"https://github.com/words/levenshtein-edit-distance","last_synced_at":"2026-02-21T08:01:16.796Z","repository":{"id":18186465,"uuid":"21303534","full_name":"words/levenshtein-edit-distance","owner":"words","description":"Levenshtein edit distance","archived":false,"fork":false,"pushed_at":"2022-11-02T10:33:03.000Z","size":115,"stargazers_count":72,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-01-14T00:44:35.871Z","etag":null,"topics":["distance","edit","levenshtein","natural-language","vladimir"],"latest_commit_sha":null,"homepage":"https://words.github.io/levenshtein-edit-distance/","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/words.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":"funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"wooorm"}},"created_at":"2014-06-28T13:43:40.000Z","updated_at":"2025-08-14T10:54:41.000Z","dependencies_parsed_at":"2022-08-25T15:50:21.735Z","dependency_job_id":null,"html_url":"https://github.com/words/levenshtein-edit-distance","commit_stats":null,"previous_names":["wooorm/levenshtein-edit-distance"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/words/levenshtein-edit-distance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Flevenshtein-edit-distance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Flevenshtein-edit-distance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Flevenshtein-edit-distance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Flevenshtein-edit-distance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/words","download_url":"https://codeload.github.com/words/levenshtein-edit-distance/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/words%2Flevenshtein-edit-distance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["distance","edit","levenshtein","natural-language","vladimir"],"created_at":"2025-10-22T18:43:55.571Z","updated_at":"2026-02-21T08:01:16.791Z","avatar_url":"https://github.com/words.png","language":"JavaScript","funding_links":["https://github.com/sponsors/wooorm"],"categories":[],"sub_categories":[],"readme":"# levenshtein-edit-distance\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n\n[Levenshtein distance][wiki] (by [Vladimir Levenshtein][vlad]).\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`levenshteinEditDistance(value, other[, insensitive])`](#levenshteineditdistancevalue-other-insensitive)\n*   [CLI](#cli)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [Security](#security)\n*   [License](#license)\n\n## What is this?\n\nThis package exposes a string similarity algorithm.\nThat means it gets two strings (typically words), and turns it into the minimum\nnumber of single-character edits (insertions, deletions or substitutions)\nneeded to turn one string into the other.\n\n## When should I use this?\n\nYou’re probably dealing with natural language, and know you need this, if\nyou’re here!\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 14.14+, 16.0+), install with [npm][]:\n\n```sh\nnpm install levenshtein-edit-distance\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {levenshteinEditDistance} from 'https://esm.sh/levenshtein-edit-distance@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {levenshteinEditDistance} from 'https://esm.sh/levenshtein-edit-distance@3?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {levenshteinEditDistance} from 'levenshtein-edit-distance'\n\nlevenshteinEditDistance('levenshtein', 'levenshtein') // =\u003e 0\nlevenshteinEditDistance('sitting', 'kitten') // =\u003e 3\nlevenshteinEditDistance('gumbo', 'gambol') // =\u003e 2\nlevenshteinEditDistance('saturday', 'sunday') // =\u003e 3\n\n// Insensitive to order:\nlevenshteinEditDistance('aarrgh', 'aargh') === levenshtein('aargh', 'aarrgh') // =\u003e true\n\n// Sensitive to ASCII casing by default:\nlevenshteinEditDistance('DwAyNE', 'DUANE') !== levenshtein('dwayne', 'DuAnE') // =\u003e true\n// Insensitive:\nlevenshteinEditDistance('DwAyNE', 'DUANE', true) === levenshtein('dwayne', 'DuAnE', true) // =\u003e true\n```\n\n## API\n\nThis package exports the identifier `levenshteinEditDistance`.\nThere is no default export.\n\n### `levenshteinEditDistance(value, other[, insensitive])`\n\nLevenshtein edit distance.\n\n###### `value`\n\nPrimary value (`string`, required).\n\n###### `other`\n\nOther value (`string`, required).\n\n###### `insensitive`\n\nCompare insensitive to ASCII casing (`boolean`, default: `false`).\n\n##### Returns\n\nDistance between `value` and `other` (`number`).\n\n## CLI\n\n```txt\nUsage: levenshtein-edit-distance [options] word word\n\nLevenshtein edit distance.\n\nOptions:\n\n  -h, --help           output usage information\n  -v, --version        output version number\n  -i, --insensitive    ignore casing\n\nUsage:\n\n# output distance\n$ levenshtein-edit-distance sitting kitten\n# 3\n\n# output distance from stdin\n$ echo \"saturday,sunday\" | levenshtein-edit-distance\n# 3\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nThis package is at least compatible with all maintained versions of Node.js.\nAs of now, that is Node.js 14.14+ and 16.0+.\nIt also works in Deno and modern browsers.\n\n## Related\n\n*   [`levenshtein.c`](https://github.com/wooorm/levenshtein.c)\n    — C API\n*   [`levenshtein`](https://github.com/wooorm/levenshtein)\n    — C CLI\n*   [`levenshtein-rs`](https://github.com/wooorm/levenshtein-rs)\n    — Rust API\n*   [`stemmer`](https://github.com/words/stemmer)\n    — porter stemming algorithm\n*   [`lancaster-stemmer`](https://github.com/words/lancaster-stemmer)\n    — lancaster stemming algorithm\n*   [`double-metaphone`](https://github.com/words/double-metaphone)\n    — double metaphone algorithm\n*   [`soundex-code`](https://github.com/words/soundex-code)\n    — soundex algorithm\n*   [`dice-coefficient`](https://github.com/words/dice-coefficient)\n    — sørensen–dice coefficient\n*   [`syllable`](https://github.com/words/syllable)\n    — syllable count of English words\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][contribute].\n\n## Security\n\nThis package is safe.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/words/levenshtein-edit-distance/workflows/main/badge.svg\n\n[build]: https://github.com/words/levenshtein-edit-distance/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/words/levenshtein-edit-distance.svg\n\n[coverage]: https://codecov.io/github/words/levenshtein-edit-distance\n\n[downloads-badge]: https://img.shields.io/npm/dm/levenshtein-edit-distance.svg\n\n[downloads]: https://www.npmjs.com/package/levenshtein-edit-distance\n\n[size-badge]: https://img.shields.io/bundlephobia/minzip/levenshtein-edit-distance.svg\n\n[size]: https://bundlephobia.com/result?p=levenshtein-edit-distance\n\n[npm]: https://www.npmjs.com\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[contribute]: https://opensource.guide/how-to-contribute/\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[wiki]: https://en.wikipedia.org/wiki/Levenshtein_distance\n\n[vlad]: https://en.wikipedia.org/wiki/Vladimir_Levenshtein\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwords%2Flevenshtein-edit-distance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwords%2Flevenshtein-edit-distance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwords%2Flevenshtein-edit-distance/lists"}