# fuzz-search-js

> library for fuzzy search

Latest version **1.0.4** (published 2021-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install fuzz-search-js
pnpm add fuzz-search-js
yarn add fuzz-search-js
bun add fuzz-search-js
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-01-26 |
| First published | 2021-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alfred Daimari |
| Maintainers | lakhanboy |
| Keywords | fuzzy, search, levenshtein, damerau-levenshtein, hamming distance, longest subsequence, edit distance, string matching, fuzzy matching |

## Links

- npm: https://www.npmjs.com/package/fuzz-search-js
- Repository: https://github.com/AlfredDaimari/fuzz-search-js
- Homepage: https://github.com/AlfredDaimari/fuzz-search-js#readme
- Issues: https://github.com/AlfredDaimari/fuzz-search-js/issues
- npm.io page: https://npm.io/package/fuzz-search-js

## 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

- 1.0.4 (latest) — 2021-01-26

## README

# fuzz-search-js

A library for implementing fuzzy search using:

- levenshtein distance algorithm
- damerau levenshtein distance algorith
- hamming distance algorithm
- longest subsequence algorithm

## Installation

Using npm:

```shell
npm i --save fuzz-search-js
```

### Options

- level: the length of the string is the starting level, how many levels should it match strings above and below its level

- max: how many strings should it return

```js
const fuzzy = require("fuzz-search-js");
// For implementing Levenshtein Distance algorithm
const fuz = new fuzzy(["helo","hello", "boy of my own","an act","personal",])
console.log(fuz.lev('helo', options={level:1, max:2})) //default {level:3, max:5}
//expected value
[{ word: "helo", score: 0 },{ word: "hello", score: 1 },]
```

## Algorithms in library for lists (how to call them)

```js
//levenshtein distance
Object.lev("String");
//damerau levenshtein
Object.dam("String");
```

## Algorithms in library for comparing two strings (will return score)

```js
//levenshtein distance
fuzzy.getLevenDis("String1", "String2");
//hamming distance
fuzzy.getHamDis("String1", "String2");
//damerau levenshtein distance
fuzzy.getDamLevDis("String1", "String2");
//longest subsequence score
fuzzy.getLongSubqDis("String1", "String2");
```

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