-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
69 lines (65 loc) · 2.49 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
const asciify = require('asciify-image');
const chalk = require('chalk');
const figlet = require('figlet');
const fs = require('fs');
const path = require('path');
const Table = require('cli-table3');
/**
* Content of digitial card
*/
const data = {
handle: 'adisakshya',
name: chalk.white.bold('Adisakshya Chauhan'),
bio: chalk.gray('Data Engineer @ ZS'),
github: chalk.gray('https://github.com/') + chalk.cyanBright('adisakshya'),
twitter: chalk.gray('https://twitter.com/') + chalk.cyanBright('adisakshya'),
linkedin: chalk.gray('https://linkedin.com/in/') + chalk.cyanBright('adisakshya'),
liveChat: chalk.gray('https://tidio.com/') + chalk.cyanBright('adisakshya'),
web: chalk.gray('https://') + chalk.cyanBright('adisakshya.github.io'),
discord: chalk.cyanBright('adisakshya#7200'),
npx: chalk.cyanBright('npx adisakshya'),
labelTwitter: chalk.white.bold(' Twitter:'),
labelGitHub: chalk.white.bold(' GitHub:'),
labelLinkedIn: chalk.white.bold(' LinkedIn:'),
labelChat: chalk.white.bold(' Live Chat:'),
labelWeb: chalk.white.bold(' Web:'),
labelDiscord: chalk.white.bold(' Discord:'),
labelCard: chalk.white.bold(' Card:')
};
const banner = figlet.textSync(data.handle, { verticalLayout: 'full' });
const heading = data.name;
const bio = data.bio;
const twitter = `${data.labelTwitter} ${data.twitter}`;
const github = `${data.labelGitHub} ${data.github}`;
const linkedin = `${data.labelLinkedIn} ${data.linkedin}`;
const liveChat = `${data.labelChat} ${data.liveChat}`;
const discord = `${data.labelDiscord} ${data.discord}`;
const card = `${data.labelCard} ${data.npx}`;
const web = `${data.labelWeb} ${data.web}`;
/**
* Options for the avatar image
*/
const avatarImageOptions = {
fit: 'box',
width: '22',
height: '22'
};
const avatarImagePath = path.join(__dirname, 'assets/avatar.jpg');
(async () => {
const avatar = await asciify(avatarImagePath, avatarImageOptions);
const output = banner + '\n' + '\n' +
heading + '\n' +
bio + '\n' + '\n' +
linkedin + '\n' +
github + '\n' +
twitter + '\n' +
web + '\n';
const table = new Table();
table.push([
{ rowSpan: 2, content: avatar},
{ content: output, vAlign: 'center' }
],[
{ content: card, hAlign: 'right', vAlign: 'center'}
]);
fs.writeFileSync(path.join(__dirname, 'bin/output'), table.toString());
})();