forked from bnb/bitandbang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.js
58 lines (53 loc) · 1.38 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
53
54
55
56
57
58
import { writeFileSync } from 'node:fs'
import boxen from 'boxen'
import { white, bold, gray, red, cyan, blue, green } from 'kleur/colors'
const boxenOptions = {
padding: 1,
margin: 1,
borderStyle: 'round',
dimBorder: true,
}
const newline = '\n'
const formatLabel = (value) => white(bold(value.padStart(12) + ':'))
const formatSocialLink = (link, username, color) => gray(link) + color(username)
const data = [
{
label: white(bold('Michael Stramel')),
value: '',
},
{
label: '',
value: white('Software Engineer') + gray(' @ Coolfire Solutions') + newline,
},
{
label: formatLabel('GitHub'),
value: formatSocialLink('https://github.com/', 'stramel', white),
},
{
label: formatLabel('npm'),
value: formatSocialLink('https://npmjs.com/~', 'stramel89', red),
},
{
label: formatLabel('Twitter'),
value: formatSocialLink('https://twitter.com/', 'stramel89', cyan),
},
{
label: formatLabel('LinkedIn'),
value: formatSocialLink('https://linkedin.com/in/', 'stramel', blue),
},
{
label: formatLabel('Website'),
value: 'COMING SOON',
},
{
label: newline + cyan('$'.padStart(13)),
value: white('npx @stramel/card'),
},
]
const output = data
.map(({ label, value }) => `${label}${label && ' '}${value}`)
.join(newline)
writeFileSync(
new URL('bin/output', import.meta.url),
green(boxen(output, boxenOptions)),
)