-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
75 lines (72 loc) · 1.96 KB
/
index.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
//Starting point of App
//Takes User Input as Requirements and sends it to Search.js
var prompt = require('prompt');
var prompt1 = require('prompt');
var search = require('./search.js');
var prompt2 = require('prompt');
var prompt3 = require('prompt');
prompt.start();
console.log("****App Started****\n");
console.log("Please Give Valid Inputs as This will help in getting Better Results\n");
console.log("Please enter Your requirements Separated by Comma(,)\n");
prompt.get(['requirements'], function (err, result) {
if (err) { return onErr(err); }
else
{
var req = result.requirements;
req = req.split(",");
console.log("Received Inputs..Would you like to have some Github stars Preference ?..(Y/n)\n");
prompt1.start();
prompt1.get(['response'], function (err, resp) {
if(err) { return onErr(err);}
else
{
var ans = resp.response;
if(ans=="n")
{
var language;
console.log("Specify the name of Language\n");
prompt3.start();
prompt3.get(['lan'],function (err,langu) {
if(err) { return onErr(err);}
else
{
language = langu.lan;
var sent = "N";
var app = new search(req,sent,language);
app.run();
}
});
}
else
{
console.log("Enter the Minimum Number of Stars you prefer.\n");
prompt2.start();
prompt2.get(['stars'],function (err, star) {
if(err) { return onErr(err);}
else
{
var langreq;
console.log("Specify the name of Language\n");
prompt3.start();
prompt3.get(['lan'],function (err,langu) {
if(err) { return onErr(err); }
else
{
langreq = langu.lan;
var starcount = star.stars;
var app = new search(req,starcount,langreq);
app.run();
}
});
}
});
}
}
});
}
});
function onErr(err) {
console.log(err);
return 1;
}