-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquizgame.ts
38 lines (36 loc) · 925 Bytes
/
quizgame.ts
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
34
35
36
37
38
import inquirer from "inquirer";
import chalk from "chalk";
let answer = await inquirer.prompt([{
message: "npm i inquirer for?",
type:"list",
name: "option",
choices:["tsconfig json","package json","node modules"]
},
{
message: "tsc --init for?",
type:"list",
name: "option2",
choices:["tsconfig json","package json","node modules"],
},
{
message: "npm init -y for?",
type:"list",
name: "option3",
choices:["tsconfig json","package json","node modules"],
}
])
if(answer.option === "node modules"){
console.log(chalk.blue("Q1: you ans is correct"))
}else{
console.log(chalk.red("try again"));
}
if(answer.option2 === "tsconfig json"){
console.log(chalk.yellow("Q2: your answer is correct"))
}else{
console.log(chalk.red("try again"))
}
if(answer.option3 === "package json"){
console.log(chalk.greenBright("Q3: your answer is correct"))
}else{
console.log(chalk.redBright("try again"))
}