levenary
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

levenary

npm-version github-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

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

Why levenary?

  1. Based on leven, the fastest JS implementation of the Levenshtein distance algorithm
  2. Only 1 API. Simple and clean. If you want more, please use didyoumean2.
  3. Flow and TypeScript support.

Benchmark

$ npm run bench
  311,915 op/s » levenary
   74,030 op/s » didyoumean
  141,423 op/s » didyoumean2

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    904,546
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    904,546
  • 1.1.0
    9,988
  • 1.0.2
    5
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i levenary

Weekly Downloads

914,539

Version

1.1.1

License

MIT

Unpacked Size

4.9 kB

Total Files

8

Last publish

Collaborators

  • tanhauhau