
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
fast-levenshtein
Advanced tools
Efficient implementation of Levenshtein algorithm with locale-specific collator support.
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
This package provides a simple implementation of the Levenshtein algorithm. It is not as performance-optimized as fast-levenshtein but is straightforward to use for basic needs.
Similar to fast-levenshtein, this package calculates the Levenshtein edit distance. It focuses on being a small and fast implementation, but fast-levenshtein might still have performance advantages in certain scenarios.
This package goes beyond just calculating the Levenshtein distance by providing a way to compare two strings and find the similarity percentage. It uses a different algorithm for comparison and can be used for more complex string comparison tasks.
Natural is a general natural language facility for Node.js. It includes a Levenshtein distance implementation among other features like tokenization, stemming, classification, phonetics, and more. It is more comprehensive but less specialized than fast-levenshtein.
FAQs
Efficient implementation of Levenshtein algorithm with locale-specific collator support.
The npm package fast-levenshtein receives a total of 28,149,242 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 for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.