Skip to content

juicyarts/inquirer-extensions

Repository files navigation

WIP | inquirer-extensions Build Status

Work in progress. This repos main purpose is to provide extensions for inquirer.

Documentation

inquirer-extension-multiInput

This plugin allows you to define a multi Input prompt.

Implementation

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-Bindings

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

Preview

asciicast

Up Next / Todos

  • 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?

inquirer-extension-multiDir (in Progress)

This plugin allows you to define a multiple Directory prompt with autocompletion.

Implementation

Key-Bindings

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

About

plugins for multi value inputs for inquirer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published