-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdeno_prompt.deno.txt
33 lines (25 loc) · 1.52 KB
/
deno_prompt.deno.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
┏━━━━━━━━━━━━━━━━━┓
┃ DENO_PROMPT ┃
┗━━━━━━━━━━━━━━━━━┛
VERSION ==> #See deno doc
alert([STR]) #Similar to DOM: print STR (def: 'Alert') and wait for Enter on stdin (unless non-interactive)
confirm([STR])->BOOL #Same but returns BOOL based on stdin answer
#Def STR 'Confirm'. False if stdin not interactive
prompt([STR[, STR2]])->STR3|null #Same but returns STR3|null answer.
#Def STR 'Prompt'. null if stdin not interactive, or if empty answer.
#STR2 is default value. "[STR2]" is appended to question STR
@std/cli/prompt-secret
promptSecret([STR[, OPTS]]) #Same but hides typed answer
->STR2|null #Def STR 'Secret'. null if stdin not interactive. '' if empty answer
OPTS.mask #'CHAR' (def: '*')
OPTS.clear #BOOL (def: false). Clear the line after submit
@std/cli/unstable-prompt-select !#
promptSelect
(STR, STR2_ARR[, OPTS])
->STR2|null #Prompts STR among possible choices STR2_ARR
OPTS.clear #Same as above
@std/cli/
unstable-prompt-multiple-select !#
promptMultipleSelect
(STR, STR2_ARR[, OPTS])
->STR2_ARR|null #Same as above, but select multiple choices