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

0.1.3 • Public • Published

fzf-node

Node.js bindings for the golang fzf fuzzy finder.

Installation

pnpm add fzf-node
# or
npm install fzf-node
# or
yarn add fzf-node

Usage

import { fzf } from 'fzf-node'

// 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-node

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

3.88 kB

Total Files

5

Last publish

Collaborators

  • _theurgi