-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
103 lines (86 loc) · 2.26 KB
/
app.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import readline from "readline-sync";
import color from "cli-color";
import register from "./users/register.js";
import login from "./users/login.js"
import createTask from "./Tasks/createTask.js";
import getall from "./Tasks/getAllTask.js";
import updating from "./Tasks/updateTask.js";
import taskdelete from "./Tasks/deleteTask.js";
import deleteUsersTask from "./Tasks/deleteAllTask.js";
import deleteall from "./Tasks/accountDelete.js";
import forgotPassword from "./users/forgotPassword.js"
export default async function main() {
try {
let c1 = color.xterm(118);
let c2 = color.xterm(7);
let c3 = color.xterm(75);
let c4 = color.xterm(218);
console.clear();
console.log(
c1(
` ----------------------------------------------------------------
---------------------WELCOME TO HANZALA'S TASKY-----------------
-------------------------SELECT THE OPTIONS---------------------
----------------------------------------------------------------`
)
);
let options = [
"For Exit",
"Register",
"Login",
"Create Task",
"Get All Task",
"Update Task",
"Delete Task",
"Delete All Task",
"Delete Account",
"Forgot Password",
];
options.forEach((value, index) => {
console.log(`${index + 1}.${value}`);
});
let option = readline.question("Enter your choice: ");
if (option < 0 || option > 3 || option == 0) {
console.log("Invalid Entry");
}
switch (option) {
case "1":
console.clear();
console.log("Thank you visit again!!");
break;
case "2":
await register();
break;
case "3":
await login();
break;
case "4":
await createTask();
break;
case "5":
await getall();
break;
case "6":
await updating();
break;
case "7":
await taskdelete();
break;
case "8":
await deleteUsersTask();
break;
case "9":
await deleteall();
break;
case "10":
await forgotPassword();
break;
default:
console.log(c3("Invalid Entry"));
break;
}
} catch (e) {
console.log("error from aap.js", e);
}
}
main();