# levenary

> [![npm-version](https://img.shields.io/npm/v/levenary.svg)](https://www.npmjs.com/package/levenary) [![github-actions](https://github.com/tanhauhau/levenary/workflows/CI/badge.svg)](https://github.com/tanhauhau/levenary/actions)

Latest version **1.1.1** (published 2020-01-28) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-01-28 |
| First published | 2019-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 6 |
| Dependencies | 1 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Tan Li Hau |
| Maintainers | tanhauhau |
| Keywords | leven, levenshtein, distance, array, string, algorithm, algo, string, difference, diff, fast, fuzzy, similar, similarity, compare, comparison, edit, text, match, matching |

## Links

- npm: https://www.npmjs.com/package/levenary
- Repository: https://github.com/tanhauhau/levenary
- npm.io page: https://npm.io/package/levenary

## Dependencies (1)

- [leven](https://npm.io/package/leven.md) ^3.1.0

## 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.1 (latest) — 2020-01-28
- 1.1.0 — 2019-12-25
- 1.0.2 — 2019-12-19
- 1.0.1 — 2019-12-19
- 1.0.0 — 2019-12-19

## README

# levenary

[![npm-version](https://img.shields.io/npm/v/levenary.svg)](https://www.npmjs.com/package/levenary)
[![github-actions](https://github.com/tanhauhau/levenary/workflows/CI/badge.svg)](https://github.com/tanhauhau/levenary/actions)

> Given a string, A and an array of strings XS, return the string X from XS whose Levenshtein distance from A is minimal.


## Install

```
$ npm install levenary
```


## Usage

```js
import levenary from 'levenary';

levenary('cat', ['cow', 'dog', 'pig']);
//=> 'cow'
```

## Why `levenary`?
1. Based on [leven](https://github.com/sindresorhus/leven), the fastest JS implementation of the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance)
1. Only 1 API. Simple and clean. If you want more, please use [didyoumean2](https://www.npmjs.com/package/didyoumean2).
1. [Flow](http://flow.org/) and [TypeScript](http://typescriptlang.org/) support.

## Benchmark

```
$ npm run bench
```

```
  311,915 op/s » levenary
   74,030 op/s » didyoumean
  141,423 op/s » didyoumean2
```

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