-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-app.js
More file actions
86 lines (69 loc) · 2.73 KB
/
cli-app.js
File metadata and controls
86 lines (69 loc) · 2.73 KB
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
const chalk = require('chalk');
var readlinesync = require('readline-sync');
/*greetings*/
console.log(chalk.bold.italic.magentaBright.underline("Welcome to Instagram\n"));
console.log(chalk.greenBright.italic('Namaste.. from instagram team'));
/* username and passcode*/
readlinesync.question(chalk.magentaBright.italic('Username:'));
var x=readlinesync.question(chalk.magentaBright.italic('Passcode:'),
{
hideEchoBack: true
});
console.log(chalk.magentaBright.italic("Entered Passcode:")+x);
// console.log('\n');
/*function and conditions*/
function services(question,resolution)
{
// console.log("question:"+question,"resolution:"+resolution);
var y = readlinesync.question(question);
if (y===resolution) {
readlinesync.question(chalk.italic.greenBright("\nCan yo please describe your problem breifly?\n") );
console.log(chalk.white.bold("Okay,so we have put your problem on our daily basis\nwe definatly sure that within 45 minutes this problem is resolve."));
} else {
console.log(chalk.red.bold("Sorry this type of problem,we can't resolve this is against to our policy.\n"));
var c=readlinesync.question(chalk.greenBright.italic('Would like to rate us ?(yes/no)'));
if (c=="yes") {
var r= readlinesync.question(chalk.greenBright.italic("just please rate out of 10 points\n"));
for(x=1;x<= 10;x++)
{
console.log(x); // so the rating system is not working .
}
} else {
console.log(chalk.white.bold("Okay,its fine if you don't want to rate."));
}
}
}
/*calling of function services*/
services(chalk.italic.greenBright("Do you facing problems with Instagram application?(yes/no)\n"),"yes" ) ;
console.log(chalk.greenBright.italic("Can you please list out your problems?(yes/no)"));
var prb = ["laaging","hangback","straggle","dull"] ;
for (let i = 0; i < prb.length; i++)
{
console.log(chalk.blue.italic(prb[i]));
}
console.log(chalk.bold.white("\nFor "+prb[0],"our team has already working on it."));
var l=readlinesync.question(chalk.greenBright.italic("Can you please tell us pros and cons of app?(yes/no)"))
if(l=="yes")
{
var pros =
{
ui:"excellent",
support:"good",
features:"best",
control:"best"
}
var cons =
{
addictive:"yes",
DND:"not providing do not disturb services",
editting:"not so much good"
}
console.log("Pros:",pros);
console.log("Cons:",cons);
console.log(chalk.italic.greenBright("Tell us the worst cons:"+cons.DND));
console.log(chalk.italic.greenBright("Tell us the best pros:"+pros.ui));
}
else
{
console.log(chalk.white.bold(("Thank you...")));
}