# tiny-levenshtein

> A tiny implementation of the Levenshtein edit distance algorithm.

Latest version **1.1.0** (published 2025-06-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-levenshtein
pnpm add tiny-levenshtein
yarn add tiny-levenshtein
bun add tiny-levenshtein
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2025-06-29 |
| First published | 2022-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Maintainers | fabiospampinato |
| Keywords | tiny, levenshtein, edit, distance |

## Links

- npm: https://www.npmjs.com/package/tiny-levenshtein
- Repository: https://github.com/fabiospampinato/tiny-levenshtein
- Homepage: https://github.com/fabiospampinato/tiny-levenshtein#readme
- Issues: https://github.com/fabiospampinato/tiny-levenshtein/issues
- npm.io page: https://npm.io/package/tiny-levenshtein

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.1.0 (latest) — 2025-06-29
- 1.0.1 — 2025-01-12
- 1.0.0 — 2022-06-21

## README

# Tiny Levenshtein

A tiny implementation of the Levenshtein edit distance algorithm.

## Install

```sh
npm install tiny-levenshtein
```

## Usage

```ts
import levenshtein from 'tiny-levenshtein';

// Let's compute the Levenshtein edit distance between two strings
// Strings are compared at the byte level

levenshtein ( 'kitten', 'sitting' ); // => 3
levenshtein ( '🤣', '😂' ); // => 2

// Let's compute the Levenshtein edit distance between two arrays
// Arrays are compared at the element level
// This can double-down as Unicode-aware string comparison too

levenshtein ( [1, 2, 3], [1, 4, 3] ); // => 1
levenshtein ( [...'🤣'], [...'😂'] ); // => 1
```

## License

MIT © Fabio Spampinato

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