Socket
Socket
Sign inDemoInstall

leven

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

leven

Measure the difference between two strings using the Levenshtein distance algorithm

    4.0.0latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
23,979,083
increased by4.22%

Weekly downloads

Package description

What is leven?

The leven npm package is a JavaScript library for measuring the difference between two strings. It uses the Levenshtein distance algorithm to calculate the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one word into the other. This can be particularly useful in applications that need to perform fuzzy matching, spell checking, or any scenario where determining how similar two strings are is necessary.

What are leven's main functionalities?

Calculate Levenshtein distance

This feature allows you to calculate the Levenshtein distance between two strings, which is the number of edits needed to transform one string into the other. The code sample demonstrates how to use the leven package to find the distance between 'kitten' and 'sitting', which is 3.

"const leven = require('leven');\nconsole.log(leven('kitten', 'sitting')); // 3"

Other packages similar to leven

Readme

Source

leven

Measure the difference between two strings using the Levenshtein distance algorithm

Install

$ npm install leven

Usage

import leven from 'leven';

leven('cat', 'cow');
//=> 2
  • leven-cli - CLI for this module

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Last updated on 10 Aug 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc