I'm using inquirer.js
for creating a yeoman-generator
and when it comes to a long list as prompt the height of it is too short to show all items. How can I increase it?. I know inquirer.js
uses an extended version of node.js's readline
, I don't know if the limitation is on this module.
Pic related:
You can use pageSize
to set num of items on page, more info
@Evgenly answer points to the correct option but I didn't find the github link particularly useful.
The pageSize
attribute allow to control the number of items to display:
inquirer
.prompt([
{
type: 'rawlist',
pageSize: 12,
name: 'event',
message: 'question?',
choices: [
'option1',
'option2',
'option3',
'option4',
'option5',
'option6',
'option7',
'option8',
'option9',
'option10',
'option11',
'exit',
]
},
])
This will output the whole 12 options in the terminal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With