Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lvce-editor/fuzzy-search

Fuzzy Search
https://github.com/lvce-editor/fuzzy-search

Last synced: 3 days ago
JSON representation

Fuzzy Search

Awesome Lists containing this project

README

        

# @lvce-editor/fuzzy-search

Fuzzy search implementation based on VSCode's implementation of the Needleman–Wunsch algorithm.

## Install

```sh
npm install @lvce-editor/fuzzy-search
```

## Usage

```js
import * as FuzzySearch from '@lvce-editor/fuzzy-search'

const pattern = 'fd'
const word = 'font-display'

const result = FuzzySearch.fuzzySearch(pattern, word) // [0, 1, 5, 6] highlight chars 0-1 (f) and 5-6 (d)
```

## Gitpod

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/lvce-editor/fuzzy-search)

## Credits

This project is based on VSCode's implementation of the Needleman–Wunsch algorithm.