What is the difference between 'List' and 'Rawlist' when using Inquirer
Asked Answered
G

1

6

I'm using inquirer and I can either make a 'list' type or a 'rawlist' type.

My goal is to allow the user to select an item from an array of products from a sql database, but I am now curious what the difference between these two list types are? In the documentation, the definitions are:

List - {type: 'list'} Take type, name, message, choices[, default, filter] properties. (Note that default must be the choice index in the array or a choice value)

and

Raw List - {type: 'rawlist'} Take type, name, message, choices[, default, filter] properties. (Note that default must be the choice index in the array)

but I don't understand what they mean, or their difference.

Glorious answered 9/5, 2018 at 0:11 Comment(0)
T
3

It looks to me like the difference is only in how the list is presented to the user. list presents them with a pointer that they can move up or down to make their selection, whereas rawlist presents them with a list to be selected by number. From what I can tell they behave identically in what they return.

Tarnish answered 29/9, 2018 at 19:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.