![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/mets.corals.io/wp-content/metras.v32.1/node_modules/leven/ |
# leven [](https://travis-ci.org/sindresorhus/leven) > Measure the difference between two strings<br> > One of the fastest JS implementations of the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) algorithm ## Install ``` $ npm install leven ``` ## Usage ```js const leven = require('leven'); leven('cat', 'cow'); //=> 2 ``` ## Benchmark ``` $ npm run bench ``` ``` 165,926 op/s » leven 164,398 op/s » talisman 1,044 op/s » levenshtein-edit-distance 628 op/s » fast-levenshtein 497 op/s » levenshtein-component 195 op/s » ld 190 op/s » levenshtein 168 op/s » levdist 10 op/s » natural ``` ## Related - [leven-cli](https://github.com/sindresorhus/leven-cli) - CLI for this module ## License MIT © [Sindre Sorhus](https://sindresorhus.com)