Skip to content

Commit

Permalink
Doc(@inquirer/input): Add doc for the required option
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Jul 3, 2024
1 parent 2285f2c commit 8656ce4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const answer = await input({ message: 'Enter your name' });
| ----------- | ----------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| message | `string` | yes | The question to ask |
| default | `string` | no | Default value if no answer is provided (clear it by pressing backspace) |
| required | `boolean` | no | Defaults to `false`. If set to true, `undefined` (empty) will not be accepted for this. |
| transformer | `(string, { isFinal: boolean }) => string` | no | Transform/Format the raw value entered by the user. Once the prompt is completed, `isFinal` will be `true`. This function is purely visual, modify the answer in your code if needed. |
| validate | `string => boolean \| string \| Promise<boolean \| string>` | no | On submit, validate the filtered answered content. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
| theme | [See Theming](#Theming) | no | Customize look of the prompt. |
Expand Down

0 comments on commit 8656ce4

Please sign in to comment.