forked from rebelchris/businesscard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
executable file
·75 lines (69 loc) · 2.45 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
71
72
73
74
75
// import chalk from 'chalk';
('use strict');
// Pull in our modules
const chalk = require('chalk');
const boxen = require('boxen');
const fs = require('fs');
const path = require('path');
// Define options for Boxen
const options = {
padding: 1,
margin: 1,
borderStyle: 'round',
};
// Text + chalk definitions
const data = {
name: chalk.white.bold(' Ruth C . Morata Gil 👋'),
// handle: chalk.white('@rebelchris'),
work: chalk.white('Junior Full Stack Developer'),
email: chalk.hex('#feb95f')('[email protected]'),
phone: chalk.blue('[+34] 646 11 66 41'),
github:
chalk.white('https://github.com/') +
chalk.green('ruthcmoratagil'),
linkedin:
chalk.white('https://linkedin.com/in/') + chalk.green('ruthcmoratagil'),
web: chalk.hex('#17bebb')('https://ruthcmoratagil.dev'),
npx: chalk.white.bgHex('#DA006050')('npx ruthcmoratagil'),
labelWork: chalk.white.bold(' Work:'),
labelEmail: chalk.white.bold(' Email:'),
labelPhone: chalk.white.bold(' Phone:'),
labelGitHub: chalk.white.bold(' GitHub:'),
labelLinkedIn: chalk.white.bold('LinkedIn:'),
labelWeb: chalk.white.bold(' Web:'),
labelCard: chalk.white.bold(' Card:'),
};
// Actual strings we're going to output
const newline = '\n';
// const heading = `${data.name} / ${data.handle}`;
const heading = `${data.name}`;
const working = `${data.labelWork} ${data.work}`;
const emailing = `${data.labelEmail} ${data.email}`;
const phoning = `${data.labelPhone} ${data.phone}`;
const githubing = `${data.labelGitHub} ${data.github}`;
const linkedining = `${data.labelLinkedIn} ${data.linkedin}`;
const webing = `${data.labelWeb} ${data.web}`;
const carding = `${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 + // data.labelWork + data.work
emailing +
newline + // data.labelEmail + data.email
phoning +
newline + // data.labelPhone + data.phone
githubing +
newline + // data.labelGitHub + data.github
linkedining +
newline + // data.labelLinkedIn + data.linkedin
webing +
newline +
newline + // data.labelWeb + data.web
carding; // data.labelCard + data.npx
fs.writeFileSync(
path.join(__dirname, 'bin/output'),
chalk.hex('#DA0060')(boxen(output, options))
);