-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.js
42 lines (35 loc) · 995 Bytes
/
log.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
const boxen = require('boxen');
const chalk = require('chalk');
const { version, description, name } = require('./package.json');
class Log {
static packageName() {
console.log(
boxen(
chalk.cyan(
`${name.split('-').map(capitalize).join(' ')} v${version} - ${description}`
),
{ padding: 1, margin: 1, borderStyle: 'double' }
)
);
}
static songAndArtist(song, artist) {
console.log('\n');
console.log(chalk.cyanBright(`The lyrics of ${song} by ${artist}`));
}
static lyrics(lyrics) {
console.log('\n');
console.log(lyrics);
}
static error() {
console.log(
chalk.red(`
This can happen because of two reasons
1: The song is not found.
2: There's a spelling mistake in artist or song.
Please make sure you have enter your inputs correctly. Thanks!
`)
);
}
}
const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1)
module.exports = Log;