Glob prompt for inquirer. Prompts for a glob and lists matching files as you type.
$ npm install --save inquirer-glob-prompt
import inquirer from 'inquirer';
import GlobPrompt from 'inquirer-glob-prompt';
// you can change 'glob' to any prefered type name
inquirer.registerPrompt('glob', GlobPrompt);
let answers = await inquirer.prompt([{
type: 'glob',
name: 'filePaths'
// ...
}]);
console.log(answers);
Takes type
, name
, message
[, default
, when
, pageSize
, glob
] properties. See
inquirer documentation for properties other than glob
.
glob (Object) options are passed directly to fast-glob during initial render and whenever input changes.
Run the example:
$ node example.js