-
Notifications
You must be signed in to change notification settings - Fork 0
/
archey.js
52 lines (45 loc) · 1.97 KB
/
archey.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
const { chalkish, chalk } = require('./utils')
function Archey({ dataOnly }, datapoints) {
this.lines = 0
this.keys = Object.keys(datapoints)
this.offset = Archey.logo.length - this.keys.length
this.logo = Archey.logo.prepare
!dataOnly && console.log(this.logo.splice(0, this.offset).join('\n'))
this.keys.map(async (point) => {
let data = await datapoints[point]
console.log(
dataOnly || Archey.logo.prepare[this.lines + this.offset],
chalk.blue(point),
chalk.whiteBright(data.trim())
)
this.lines++
if (this.lines == this.keys.length - 1) {
console.log('\n\n')
process.exit(0)
}
})
}
Archey.logo = {
string: `
{green.bold ••• }
{green.bold •••• }
{green.bold ••• }
{green.bold ••••••• ••••••• }
{yellow.bold ••••••••••••••••••••• }
{yellow.bold ••••••••••••••••••••• }
{red.bold •••••••••••••••••••• }
{red.bold •••••••••••••••••••• }
{red.bold ••••••••••••••••••••• }
{magenta.bold •••••••••••••••••••• }
{magenta.bold ••••••••••••••••••••• }
{blue.bold •••••••••••••••• }
{blue.bold •••• ••••• }
`,
get prepare() {
return chalkish`${this.string}`.split('\n')
},
get length() {
return this.prepare.length
},
}
module.exports = Archey