Package Exports
- levenshteinjs
- levenshteinjs/levenshtein.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (levenshteinjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Levenshtein distance
Calculate the Levenshtein distance between two strings.
The Levenshtein distance between two strings is the minimum number of single-character edits (insertions, deletions or substitutions) required to change one string into the other.
Demo
https://lab.miguelmota.com/levenshtein
Install
npm install levenshteinjsUsage
const levenshteinDistance = require('levenshteinjs');
console.log(levenshteinDistance('foo', 'foo')) // 0
console.log(levenshteinDistance('foo', 'fob')) // 1
console.log(levenshteinDistance('flaw', 'lawn')) // 2
console.log(levenshteinDistance('kitten', 'sitting')) // 3Test
npm testLicense
MIT