5.7.1.7 ask.mjs
The Reach JavaScript standard library also provides the helper module @reach-sh/stdlib/ask.mjs for constructing console interfaces to your frontends.
It provides the following exports:
ask(string, (string => result)) => Promise<result>
yesno(string) => boolean
done() => null
ask
is an asynchronous function that asks a question on the console and returns a Promise for the first result that its second argument does not error on.
yesno
is an argument appropriate to give as the second argument to ask
that parses "Yes"/"No" answers.
done
indicates that no more questions will be asked.