fast-levenshtein
Advanced tools
Weekly downloads
Readme
A Javascript implementation of the Levenshtein algorithm with locale-specific collator support. This uses fastest-levenshtein under the hood.
$ npm install fast-levenshtein
CDN
The latest version is now also always available at https://npm-cdn.com/pkg/fast-levenshtein/
Default usage
var levenshtein = require('fast-levenshtein');
var distance = levenshtein.get('back', 'book'); // 2
var distance = levenshtein.get('我愛你', '我叫你'); // 1
Locale-sensitive string comparisons
It supports using Intl.Collator for locale-sensitive string comparisons:
var levenshtein = require('fast-levenshtein');
levenshtein.get('mikailovitch', 'Mikhaïlovitch', { useCollator: true});
// 1
To build the code and run the tests:
$ npm install -g grunt-cli
$ npm install
$ npm run build
This uses fastest-levenshtein under the hood.
If you wish to submit a pull request please update and/or create new tests for any changes you make and ensure the grunt build passes.
See CONTRIBUTING.md for details.
MIT - see LICENSE.md
FAQs
Efficient implementation of Levenshtein algorithm with locale-specific collator support.
The npm package fast-levenshtein receives a total of 27,493,075 weekly downloads. As such, fast-levenshtein popularity was classified as popular.
We found that fast-levenshtein demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.