-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.js
52 lines (39 loc) · 1.36 KB
/
build.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
#!/usr/bin/env node
'use strict'
const boxen = require('boxen')
const { bold, blueBright: b } = require('chalk').default
const fs = require('fs')
const path = require('path')
///////////////////////////////////////////////////////////////////////////////
const title = `${bold(` Edy Tama Kusumajaya`)} · edytk`
const subtitle = ` Yogyakarta, ID · ${b(`[email protected]`)}`
const header = `${title}\n${subtitle}`
///////////////////////////////////////////////////////////////////////////////
const list = {
[bold(` Work`)]: `Life-Long Learner :)`,
[bold(` GitHub`)]: b(`https://github.com/edytk`),
[bold(`LinkedIn`)]: b(`https://linkedin.com/in/edytk`),
[bold(` Twitter`)]: b(`https://twitter.com/tama0x1`),
[bold(` Website`)]: b(`https://et.mk`),
}
const renderedList = Object.keys(list)
.map(l => `${l}: ${list[l]}`)
.join('\n')
///////////////////////////////////////////////////////////////////////////////
const footer = `${bold(` Card`)}: npx edytk`
///////////////////////////////////////////////////////////////////////////////
const cardContent = `${header}\n\n${renderedList}\n\n${footer}`
fs.writeFileSync(
path.join(__dirname, 'bin/output'),
boxen(cardContent, {
borderColor: 'blue',
margin: 1,
padding: {
top: 1,
bottom: 1,
left: 6,
right: 6,
},
})
)
// huge thanks to https://github.com/bnb/bitandbang