Measure the difference between two strings with the fastest JS implementation of the Levenshtein distance algorithm
JavaScript
Clone or download
Permalink
Failed to load latest commit information.
.editorconfig Meta tweaks Dec 15, 2016
.gitattributes Meta tweaks Dec 15, 2016
.gitignore
.travis.yml Meta tweaks Dec 15, 2016
bench.js
index.js
license init Aug 9, 2014
package.json
readme.md Update bench results (Using Node.js 7.5.0) Feb 14, 2017
test.js update tests for latest AVA version Dec 31, 2015

readme.md

leven Build Status

Measure the difference between two strings
The fastest JS implementation of the Levenshtein distance algorithm

Install

$ npm install --save leven

Usage

const leven = require('leven');

leven('cat', 'cow');
//=> 2

Benchmark

$ npm run bench
         401,487 op/s » leven
         371,707 op/s » talisman
         264,191 op/s » levenshtein-edit-distance
         152,923 op/s » fast-levenshtein
          57,267 op/s » levenshtein-component
          19,915 op/s » levdist
          21,802 op/s » ld
          18,079 op/s » natural
          11,761 op/s » levenshtein

Related

License

MIT © Sindre Sorhus