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

levenshtein-edit-distance

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

levenshtein-edit-distance

Levenshtein edit distance. No cruft. Real fast.

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
269K
increased by9.12%
Maintainers
2
Weekly downloads
 
Created
Source

levenshtein-edit-distance Build Status Coverage Status

Levenshtein edit distance (by Vladimir Levenshtein). No cruft. Real fast.

API

Install:

npm install levenshtein-edit-distance

Use:

var levenshtein = require('levenshtein-edit-distance');

levenshtein('levenshtein', 'levenshtein'); //=> 0
levenshtein('sitting', 'kitten'); //=> 3
levenshtein('gumbo', 'gambol'); //=> 2
levenshtein('saturday', 'sunday'); //=> 3

/* Case sensitive! */
levenshtein('DwAyNE', 'DUANE') !== levenshtein('dwayne', 'DuAnE'); //=> true

/* Insensitive: */
levenshtein('DwAyNE', 'DUANE', true) === levenshtein('dwayne', 'DuAnE', true); //=> true

/* Order insensitive */
levenshtein('aarrgh', 'aargh') === levenshtein('aargh', 'aarrgh'); //=> true

CLI

Install:

npm install -g levenshtein-edit-distance

Use:

Usage: levenshtein-edit-distance [options] word word

Levenshtein edit distance. No cruft. Real fast.

Options:

  -h, --help           output usage information
  -v, --version        output version number
  -i, --insensitive    ignore casing

Usage:

# output distance
$ levenshtein-edit-distance sitting kitten
# 3

# output distance from stdin
$ echo "saturday,sunday" | levenshtein-edit-distance
# 3

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 06 Nov 2017

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