fzf-bun
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

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

Package Sidebar

Install

npm i fzf-bun

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

3.68 kB

Total Files

5

Last publish

Collaborators

  • _theurgi