{"library":"node-fzf","title":"node-fzf: Fuzzy CLI List Selector","description":"node-fzf is a Node.js utility inspired by the `fzf` command-line fuzzy finder, providing an interactive CLI for list selection. It enables developers to integrate fuzzy searching capabilities into their Node.js applications, offering both a standalone CLI and a programmatic API. The current stable version is 0.14.0, published approximately 10 months ago, suggesting a maintenance or slow release cadence rather than rapid iteration. Key differentiators include its promise-based and callback-based API for integration, support for piping input and output with other CLI tools, and customizable display options like height and pre/post-line hooks. Unlike `fzf-node` which are direct Go bindings, `node-fzf` is a pure JavaScript implementation.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-fzf"],"cli":{"name":"fzf","version":null}},"imports":["const nfzf = require('node-fzf')","const { getInput } = require('node-fzf'); // or nfzf.getInput"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const nfzf = require('node-fzf');\n\nconst opts = {\n  list: ['apple', 'banana', 'orange', 'grape', 'strawberry', 'blueberry', 'raspberry', 'pineapple', 'mango', 'kiwi'],\n  mode: 'fuzzy',\n  query: '',\n  selectOne: false,\n  height: 50, // Use 50% of the screen height\n  prelinehook: function (index) { return `[${index + 1}] `; },\n  postlinehook: function (index) { return ` (${this.list[index].length} chars)`; }\n};\n\n(async function () {\n  console.log('Starting fuzzy search. Use Ctrl-S to switch modes, Up/Down to navigate.');\n  const result = await nfzf(opts);\n\n  const { selected, query } = result;\n\n  if (!selected) {\n    console.log(`No match found for query: '${query}'`);\n  } else {\n    console.log(`\\nSelected item: '${selected.value}' at index ${selected.index}`);\n    console.log(`Original list item: '${opts.list[selected.index]}'`);\n  }\n  process.exit(0); // Ensure the process exits after selection\n})();","lang":"javascript","description":"This quickstart demonstrates the promise-based API of `node-fzf` to present an interactive fuzzy selection list to the user, allowing them to pick an item from a predefined array. It showcases basic configuration, result handling, and interactive features.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}