Work in progress. This repos main purpose is to provide extensions for inquirer.
This plugin allows you to define a multi Input prompt.
inquirer.registerPrompt('multiInput', require('../src/inquirer-extensions').multiInput)
inquirer.prompt([{
type: 'multiInput',
name: 'multiInput',
message: 'Which Keywords do you want to pass'
}]).then(function (answers) {
console.log(JSON.stringify(answers, null, ' '))
// outputs array of answers like this if you input
// wow ↓
// much ↓
// multi ↓
// such ↓
// ↵
// {
// "multiInput": [
// "such",
// "multi",
// "much",
// "wow"
// ]
// }
//
})
Key | Condition | Action |
---|---|---|
Enter ↵ | without input | returns an empty array |
value Enter↵ | with input | returns an array with the given argument as string |
Arrow-Down ↓ | without input | prompts an info |
value Arrow-Down ↓ | with input | adds value to an array of strings |
Enter ↵ | when finished | inputs returns array of given values as strings |
- Paginator is currentliy fixed to 8 elements, make this scrollable between separators
- maybe like in vim via ctrl+v => visual mode, keys=>navigation
- Make previous choices removable/(editable?) in visual mode
- allow reordering/sorting?
This plugin allows you to define a multiple Directory prompt with autocompletion.
Key | Condition | Action |
---|---|---|
Tab ↹ | autocompletion | |
Enter ↵ | without input | returns an empty array |
value Enter↵ | with input | returns an array with the given argument as string |
Arrow-Down ↓ | without input | prompts an info |
value Arrow-Down ↓ | with input | adds value to an array of strings |
Enter ↵ | when finished | inputs returns array of given values as strings |