Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajitid/fzf-for-js
Do fuzzy matching using FZF algorithm in JavaScript
https://github.com/ajitid/fzf-for-js
find fuzzy fuzzy-match fuzzy-search fzf javascript js search
Last synced: 13 days ago
JSON representation
Do fuzzy matching using FZF algorithm in JavaScript
- Host: GitHub
- URL: https://github.com/ajitid/fzf-for-js
- Owner: ajitid
- License: bsd-3-clause
- Created: 2021-06-27T15:59:22.000Z (over 3 years ago)
- Default Branch: dev
- Last Pushed: 2024-08-11T13:25:42.000Z (3 months ago)
- Last Synced: 2024-10-26T01:03:41.809Z (19 days ago)
- Topics: find, fuzzy, fuzzy-match, fuzzy-search, fzf, javascript, js, search
- Language: TypeScript
- Homepage: https://fzf.netlify.app
- Size: 1.44 MB
- Stars: 886
- Watchers: 5
- Forks: 21
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: license.txt
Awesome Lists containing this project
README
# FZF for JavaScript
[![Tests](https://github.com/ajitid/fzf-for-js/actions/workflows/main.yml/badge.svg?branch=dev)](https://github.com/ajitid/fzf-for-js/actions/workflows/main.yml)
[![Docs deployment status](https://img.shields.io/netlify/e4324b0d-d5b2-4139-a688-e58f32a5af6b?label=Docs&logo=netlify)](https://app.netlify.com/sites/fzf/deploys)[//]: # "Image, text and counter/assist image needs to follow this order to be correctly aligned"
[Docs](https://fzf.netlify.app) · [Demo](https://fzf.netlify.app/docs/latest/basic) · [GitHub](https://github.com/ajitid/fzf-for-js) · [NPM](https://www.npmjs.com/package/fzf)
Originally available as [a fuzzy finder for CLIs](https://github.com/junegunn/fzf), FZF for JavaScript is a port of FZF's main algorithm so it can be used in browser context.
## Quick look
Install FZF for JavaScript using:
```sh
npm i fzf
```Then you can use it like:
```js
import { Fzf } from 'fzf'const list = ['go', 'javascript', 'python', 'rust',
'swift', 'kotlin', 'elixir', 'java',
'lisp', 'v', 'zig', 'nim', 'rescript',
'd', 'haskell']const fzf = new Fzf(list)
const entries = fzf.find('li')
console.log('ranking is:')
entries.forEach(entry => console.log(entry.item)) // lisp kotlin elixir
```For more ways to use this library, [visit documentation](https://fzf.netlify.app/).
## Motivation
Command palette is becoming ubiquitous – you can find it in code editors ([Sublime Text](https://www.sublimetext.com/blog/articles/sublime-text-2-beta), VS Code), design tools ([Figma](https://forum.figma.com/t/new-quick-actions-menu/1788)), project management apps ([Height](https://twitter.com/michaelvillar/status/1347276324772192256), [Linear](https://linear.app/)), source control tools ([Fork](https://fork.dev/blog/posts/quick-launch/), Sublime Merge). Web apps are becoming more prevalent as well. FZF has a great fuzzy finding mechanism which could be used outside of CLI and into these palettes.
There is [a very good read](https://web.archive.org/web/20211130170018/https://capiche.com/e/consumer-dev-tools-command-palette) about command palettes if you want to learn more.
## Thanks
- Junegunn Choi (author of FZF, [website](https://junegunn.kr/)) – for making his work available and accessible to us. You can [sponsor his project](https://github.com/junegunn/fzf).