fzf-bun
v0.1.3
Published
Bun bindings for the golang fzf fuzzy finder
Downloads
7
Maintainers
Readme
fzf-bun
Bun bindings for the golang fzf fuzzy finder.
Installation
bun add fzf-bun
Usage
import { fzf } from 'fzf-bun'
// Run `man fzf` in your shell to see all available fzf options
const fzfOptions = ['--multi', '--preview-window=up', '--preview', 'echo {}']
const selections = ['Pen ✒️', 'Pineapple 🍍', 'Apple 🍎', 'Pen ✒️']
const selection = await fzf(selections, fzfOptions)
// Do something with selection
console.log(selection)
API
fzf(selections: string[], options?: OptionType[])
Runs fzf as a child process with the specified options and returns the selected item(s).
Return type
Promise<T extends '--multi' ? string[] : string>
If the --multi
fzf option is provided to options?: OptionType[]
then fzf
will return Promise<string[]>
otherwise it will return Promise<string>
.