input.select
Prompts the user with a select menu using Enquirer and logs the selected response.
Parameters:
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
option | Object | Configuration object containing the prompt details. Properties
|
Returns:
- Type:
- Promise.<Object>
Example
import { input } from "@jlongyam/cli";
let result = await input.select({
key: 'word',
question: 'choose one: ',
option: ['one', 'two', 'three', 'four']
});
console.log(result.word);