@pega/inquirer-fuzzy-path
Overview
This @pega project is based upon fuzzy-path found here: https://www.npmjs.com/package/inquirer-fuzzy-path
Fuzzy path works with npm inquirer to help when typing in paths.
Fuzzy file/directory search and select prompt for Inquirer.js

Project has been modified:
- fixed bugs
- updated dependenices
- updated to module to be used in modules
- internal for Pegasystems usage (according to MIT license)
Teams responsible
Usage
Register the prompt with inquirer:
inquirer.registerPrompt('fuzzypath', require('inquirer-fuzzy-path'))
Call the prompt:
return inquirer.prompt([
{
type: 'fuzzypath',
name: 'path',
excludePath: nodePath => nodePath.startsWith('node_modules'),
excludeFilter: nodePath => nodePath == '.',
itemType: 'any',
rootPath: 'app',
message: 'Select a target directory for your component:',
default: 'components/',
suggestOnly: false,
depthLimit: 5,
}
]);
Change log
- In version 3.0.0 brought in @pega and fixed search crash with defaults for choice values
Based upon:
- In version 2.2.0 new option
excludeFilter
was added. - In version 2.1.0 new option
depthLimit
was added. - In version 2.0.0 option
filterPath
was deprecated. Please use excludePath
and itemType
instead.
Related
- inquirer - A collection of common interactive command line user interfaces
License
MIT © adelsz