Inquirer.js
Inquirer.js copied to clipboard
Feat: @inquirer/prompts checkbox support children
When using checkbox, being able to set choice.childrens.
Usage proposal:
await checkbox({
message: 'Select domains to deploy',
choices: [
{
name: 'snacks',
value: 'SNACKS',
childrens: [
{ name: 'chips', value: 'CHIPS' },
{ name: 'donuts', value: 'DONUTS' },
],
},
{
name: 'burgers',
value: 'BURGERS',
childrens: [
{ name: 'Big Mac', value: 'BIGMAC' },
{ name: 'Double Chees', value: 'DOUBLE_CHEESE' },
],
},
]
});
I was using that one in the past but it is no longer compatible with the latest releases: https://github.com/insightfuls/inquirer-tree-prompt
Example:
Hi, thanks for reaching out!
Quickly looking at the download stats of the tree prompts on Github, I don't think it is a pattern with enough usage to warrant including within the core.
Though that's why the modern version of Inquirer ship with an easy to build upon API, and a whole testing framework. I'd encourage you to implement a custom community prompt, and adding it to the repo README! Doc on building custom prompt is here