-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
executable file
·70 lines (60 loc) · 1.92 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
59
60
61
62
63
64
65
66
67
68
69
70
'use strict';
// Pull in our modules
import chalk from 'chalk';
import boxen from 'boxen';
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
// Define options for Boxen
const options = {
padding: 1,
margin: 1,
borderStyle: 'round'
};
const { white, gray, cyan, red, green, blue } = chalk;
const data = {
name: white(' John Woodruff'),
location: white(' Utah, USA'),
handle: white('johnbwoodruff'),
work: white('Senior Software Engineer at Mosaic'),
// Social links
links: {
bluesky: `${gray('https://bsky.app/profile/')}${cyan('johnbwoodruff.com')}`,
npm: `${gray('https://npmjs.com/')}${red('~johnbwoodruff')}`,
github: `${gray('https://github.com/')}${green('johnbwoodruff')}`,
dev: `${gray('https://dev.to/')}${green('johnbwoodruff')}`,
linkedin: `${gray('https://linkedin.com/in/')}${blue('johnbwoodruff')}`,
web: cyan('https://johnbwoodruff.com'),
},
// Labels
labels: {
work: white.bold(' Work:'),
bluesky: white.bold(' Bluesky:'),
npm: white.bold(' npm:'),
github: white.bold(' GitHub:'),
dev: white.bold(' Blog:'),
linkedin: white.bold(' LinkedIn:'),
web: white.bold(' Web:'),
card: white.bold(' Card:'),
},
npx: `${red('npx')} ${white('johnbwoodruff')}`,
};
const output = [
`${data.name} / ${data.handle}`,
data.location,
'',
`${data.labels.work} ${data.work}`,
`${data.labels.bluesky} ${data.links.bluesky}`,
`${data.labels.npm} ${data.links.npm}`,
`${data.labels.github} ${data.links.github}`,
`${data.labels.linkedin} ${data.links.linkedin}`,
`${data.labels.dev} ${data.links.dev}`,
`${data.labels.web} ${data.links.web}`,
'',
`${data.labels.card} ${data.npx}`,
].join('\n');
const __dirname = fileURLToPath(new URL('.', import.meta.url));
fs.writeFileSync(
path.join(__dirname, 'bin/output'),
chalk.green(boxen(output, options))
);