Socket
Socket
Sign inDemoInstall

leven

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    leven

Measure the difference between two strings using the Levenshtein distance algorithm


Version published
Weekly downloads
25M
increased by2.1%
Maintainers
1
Install size
6.02 kB
Created
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 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.

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