https://github.com/sindresorhus/leven
  
  
    Measure the difference between two strings with the fastest JS implementation of the Levenshtein distance algorithm 
    https://github.com/sindresorhus/leven
  
        Last synced: 6 months ago 
        JSON representation
    
Measure the difference between two strings with the fastest JS implementation of the Levenshtein distance algorithm
- Host: GitHub
 - URL: https://github.com/sindresorhus/leven
 - Owner: sindresorhus
 - License: mit
 - Created: 2014-08-09T20:34:03.000Z (about 11 years ago)
 - Default Branch: main
 - Last Pushed: 2025-04-12T16:30:28.000Z (7 months ago)
 - Last Synced: 2025-05-05T18:14:02.165Z (6 months ago)
 - Language: JavaScript
 - Homepage:
 - Size: 25.4 KB
 - Stars: 722
 - Watchers: 13
 - Forks: 28
 - Open Issues: 2
 - 
            Metadata Files:
            
- Readme: readme.md
 - Funding: .github/funding.yml
 - License: license
 - Security: .github/security.md
 
 
Awesome Lists containing this project
- awesome-nodejs - leven - Measure the difference between two strings using the Levenshtein distance algorithm.  (Repository / Natural language processing)
 - awesome-nodejs-cn - leven - **star:721** 使用Levenshtein距离算法测量两个字符串之间的差异 (包 / 自然语言处理)
 - awesome-github-star - leven
 - awesome-imgcook - sindresorhus/leven - Measure the difference between two strings using the Levenshtein distance algorithm. (JavaScript packages for machine learning / Natural language processing)
 - awesome-nodejs - leven - Measure the difference between two strings using the Levenshtein distance algorithm. (Packages / Natural language processing)
 - awesome-node - leven - Measure the difference between two strings using the Levenshtein distance algorithm. (Packages / Natural language processing)
 - awesome-nodejs-cn - leven - 使用Levenshtein距离算法测量两个字符串之间的差异. (目录 / NLP自然语言处理)
 - awesome-nodejs - leven - Measure the difference between two strings with the fastest JS implementation of the Levenshtein distance algorithm - ★ 391 (Natural language processing)
 - awesome-nodejs-cn - leven - 使用 Levenshtein 距离算法检测两个字符串之间的差异 (包 / 自然语言处理)
 - fucking-awesome-nodejs - leven - Measure the difference between two strings using the Levenshtein distance algorithm. (Packages / Natural language processing)
 - fucking-awesome-nodejs - leven - Measure the difference between two strings using the Levenshtein distance algorithm. (Packages / Natural language processing)
 
README
          # leven
> Measure the difference between two strings using the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) algorithm
## Install
```
$ npm install leven
```
## Usage
```js
import leven from 'leven';
leven('cat', 'cow');
//=> 2
```
## Related
- [leven-cli](https://github.com/sindresorhus/leven-cli) - CLI for this module
---
	
		Get professional support for this package with a Tidelift subscription
	
	
	
		Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.