-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
59 lines (52 loc) · 2.14 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
'use strict'
// Pull in our modules
import chalk from 'chalk'
import boxen from 'boxen'
import fs from 'node:fs'
import { fileURLToPath } from 'node:url'
import path from 'node:path'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
// Define options for Boxen
const options = {
padding: 1,
margin: 1,
borderStyle: 'round'
}
// Text + chalk definitions
const data = {
name: 'Peter Siska',
handle: 'peschee',
work: 'Executive Board Member at Inventage AG',
workUrl: 'https://inventage.com',
twitter: 'https://twitter.com/peschee',
npm: 'https://npmjs.com/~peschee',
github: 'https://github.com/peschee',
linkedin: 'https://linkedin.com/in/pesche',
npx: 'npx peschee',
labelWork: 'Work:',
labelTwitter: 'Twitter:',
labelnpm: 'npm:',
labelGitHub: 'GitHub:',
labelLinkedIn: 'LinkedIn:',
labelCard: 'Card:'
}
// Actual strings we're going to output
const newline = '\n'
const heading = chalk.white(` ${chalk.bold(data.name)} / ${data.handle}`)
let working = chalk.white(`${chalk.bold(data.labelWork)} ${data.work}`)
working += chalk.white(`${newline} ${data.workUrl}`)
const twittering = chalk.white(`${chalk.bold(data.labelTwitter)} ${data.twitter}`)
const npming = chalk.white(`${chalk.bold(data.labelnpm)} ${data.npm}`)
const githubing = chalk.white(`${chalk.bold(data.labelGitHub)} ${data.github}`)
const linkedining = chalk.white(`${chalk.bold(data.labelLinkedIn)} ${data.linkedin}`)
const carding = chalk.white(`${chalk.bold(data.labelCard)} ${data.npx}`)
// Put all our output together into a single variable so we can use boxen effectively
const output = heading + // data.name + data.handle
newline + newline + // Add one whole blank line
working + newline + newline + // data.labelWork + data.work + data.workUrl
twittering + newline + // data.labelTwitter + data.twitter
githubing + newline + // data.labelGitHub + data.github
linkedining + newline + // data.labelLinkedIn + data.linkedin
npming + newline + // data.labelnpm + data.npm
newline + carding // data.labelCard + data.npx
fs.writeFileSync(path.join(__dirname, 'bin/output'), chalk.green(boxen(output, options)))