summary refs log tree commit diff
path: root/scripts/utils
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 00:44:13 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 00:44:13 +1000
commit314a4787ce55a091cb89ef4281d7ba09e8323fa4 (patch)
treed77142c009e9c6d45390a8fe01c9aee966d7a4cc /scripts/utils
parentMerge remote-tracking branch 'upstream/staging' into feat/captchaVerify (diff)
parentcase insensitive header for rate limits, fix rate limit default settings (diff)
downloadserver-314a4787ce55a091cb89ef4281d7ba09e8323fa4.tar.xz
Merge remote-tracking branch 'upstream/staging' into feat/captchaVerify
Diffstat (limited to 'scripts/utils')
-rw-r--r--scripts/utils/ask.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/utils/ask.js b/scripts/utils/ask.js
new file mode 100644

index 00000000..cb8a29f6 --- /dev/null +++ b/scripts/utils/ask.js
@@ -0,0 +1,20 @@ +const readline = require("readline"); +const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); + +async function ask(question) { + return new Promise((resolve, _reject) => { + return rl.question(question, (answer) => { + resolve(answer); + }); + }).catch((err) => { + console.log(err); + }); +} +async function askBool(question) { + return /y?/i.test(await ask(question)); +} + +module.exports = { + ask, + askBool +} \ No newline at end of file