-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrender.js
36 lines (33 loc) · 829 Bytes
/
render.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
import chalk from "chalk";
const log = console.log;
const renderResult = (result, page, pointer) => {
result.forEach((el, index) => {
if (pointer == index) {
log(
chalk.green(
`=> ${el.movieName}`,
chalk.blue(`- ${el.release}`, chalk.yellow(`${el.language}`))
)
);
} else {
log(
chalk.green(
` ${el.movieName}`,
chalk.blue(`- ${el.release}`, chalk.yellow(`${el.language}`))
)
);
}
});
if (pointer == 5) {
log(chalk.blue.bgWhite("< Previous"));
} else {
log(chalk.blue("< Previous"));
}
if (pointer == 6) {
log(chalk.blue.bgWhite("Next >"));
} else {
log(chalk.blue("Next >"));
}
log(chalk.cyan(`+++++++++++++++++++++ page ${page} +++++++++++++++++++++`));
};
export { renderResult };