node-levenshtein :rocket:
Fastest implementation of the Levenshtein distance algorithm - (approx. 60+ percent faster than the 2nd fastest implementation). This algorithm can be used to measure the similarity of two strings.
Install
$ npm install node-levenshtein --save
Usage
var levenshtein = require('node-levenshtein')
console.log(levenshtein('lorem', 'ipsum'))
Benchmark
1,000 words
---
6,152 ops/sec -> node-levenshtein
4,373 ops/sec -> js-levenshtein
4,108 ops/sec -> leven
4,735 ops/sec -> levenshtein-Edit-Distance
2,208 ops/sec -> fast-levenshtein
100 Sentences
---
2,840 ops/sec -> node-levenshtein
1,764 ops/sec -> js-levenshtein
1,082 ops/sec -> leven
1,009 ops/sec -> levenshtein-Edit-Distance
273 ops/sec -> fast-levenshtein
10 paragraphs
---
267 ops/sec -> node-levenshtein
164 ops/sec -> js-levenshtein
95 ops/sec -> leven
90 ops/sec -> levenshtein-Edit-Distance
21 ops/sec -> fast-levenshtein