-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
45 lines (41 loc) · 972 Bytes
/
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
#!/usr/bin/env node
const cli = require('inquirer')
const figlet = require('figlet')
const chalk = require('chalk')
const clear = require('clear')
const SerieController = require('./src/controllers/SerieController')
clear()
console.log(
chalk.blue(
figlet.textSync("Minha Serie", {
horizontalLayout: "full"
})
)
)
cli
.prompt([{
type: "list",
name: "main_option",
message: chalk.hex("#72e060").bold("O que deseja fazer?"),
prefix: "*",
choices: [{
value: 1,
name: "Top series"
},
{
value: 2,
name: "Buscar serie"
},
]
}])
.then(answers => {
if (answers.main_option === 1) {
SerieController.top()
}
if (answers.main_option === 2) {
SerieController.search()
}
})
.catch(err => {
console.log(err)
})