Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leven

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leven

Measure the difference between two strings using the Levenshtein distance algorithm

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11M
decreased by-58.26%
Maintainers
1
Weekly downloads
 
Created

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

Keywords

FAQs

Package last updated on 10 Aug 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc