# levenshteinjs

> Calculate the Levenshtein distance between two strings.

Latest version **0.0.2** (published 2022-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install levenshteinjs
pnpm add levenshteinjs
yarn add levenshteinjs
bun add levenshteinjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2022-03-11 |
| First published | 2017-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Miguel Mota |
| Maintainers | miguelmota |
| Keywords | levenshtein, distance, algorithm, string, nlp, hamming |

## Links

- npm: https://www.npmjs.com/package/levenshteinjs
- Repository: https://github.com/miguelmota/levenshtein
- Issues: https://github.com/miguelmota/levenshtein/issues
- npm.io page: https://npm.io/package/levenshteinjs

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2022-03-11
- 0.0.1 — 2017-10-23

## README

# Levenshtein distance

> Calculate the [Levenshtein distance](https://en.wikipedia.org/wiki/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](https://lab.miguelmota.com/levenshtein)

# Install

```bash
npm install levenshteinjs
```

# Usage

```javascript
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')) // 3
```

# Test

```bash
npm test
```

# License

MIT

---
_Source: https://npm.io/package/levenshteinjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
