FZF for JavaScript

Do fuzzy matching using FZF algorithm in JavaScript

README

FZF for JavaScript

Tests Docs deployment status

[//]: # "Image, text and counter/assist image needs to follow this order to be correctly aligned"


Docs · Demo · GitHub · NPM

Originally available as a fuzzy finder for CLIs, 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:

  1. ```sh
  2. npm i fzf
  3. ```

Then you can use it like:


  1. ``` js
  2. import { Fzf } from 'fzf'

  3. const list = ['go', 'javascript', 'python', 'rust',
  4.               'swift', 'kotlin', 'elixir', 'java',
  5.               'lisp', 'v', 'zig', 'nim', 'rescript',
  6.               'd', 'haskell']

  7. const fzf = new Fzf(list)
  8. const entries = fzf.find('li')
  9. console.log('ranking is:')
  10. entries.forEach(entry => console.log(entry.item)) // lisp kotlin elixir
  11. ```

For more ways to use this library, visit documentation.

Motivation


Command palette is becoming ubiquitous – you can find it in code editors (Sublime Text, VS Code), design tools (Figma), project management apps (Height, Linear), source control tools (Fork, 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 about command palettes if you want to learn more.

Thanks


- Junegunn Choi (author of FZF, website) – for making his work available and accessible to us. You can sponsor his project.