Skip to content

Commit 0468a03

Browse files
committed
Updates
1 parent 2e5caf0 commit 0468a03

File tree

7 files changed

+1954
-1087
lines changed

7 files changed

+1954
-1087
lines changed

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": false,
5+
"singleQuote": true
6+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.tabSize": 2,
3+
"editor.formatOnSave": true
4+
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Tierney Cyren
3+
Copyright (c) 2018 Michael Stramel
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
It's me, Tierney!
2-
31
# Usage
42
Via npx:
53
```
6-
npx bitandbang
4+
npx stramel
75
```
86

9-
Not including how to use it globally because I'm not sure why you'd want this as a global command. That'd be creepy.
7+
Not including how to use it globally because I'm not sure why you'd want this as a global command. That'd be creepy.
8+
9+
# Credit
10+
11+
Huge shoutout and thanks to [Tierney](https://github.com/bnb) who originally wrote this.

bin/card.js

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,55 @@
11
#!/usr/bin/env node
2-
// 👆 Used to tell Node.js that this is a CLI tool
32

4-
// Pull in our modules
5-
const chalk = require('chalk')
63
const boxen = require('boxen')
4+
const chalk = require('chalk')
5+
const leftPad = require('left-pad')
76

8-
// Define options for Boxen
9-
const options = {
7+
const boxenOptions = {
108
padding: 1,
119
margin: 1,
12-
borderStyle: 'round'
10+
borderStyle: 'round',
1311
}
1412

15-
// Text + chalk definitions
16-
const data = {
17-
name: chalk.white('Tierney Cyren /'),
18-
handle: chalk.cyan('bitandbang'),
19-
work: chalk.white('Senior Cloud Developer Advocate at Microsoft'),
20-
twitter: chalk.cyan('https://twitter.com/bitandbang'),
21-
github: chalk.cyan('https://github.com/bnb'),
22-
linkedin: chalk.cyan('https://linkedin.com/in/bitandbang'),
23-
web: chalk.cyan('https://bnb.im'),
24-
npx: chalk.white('npx bitandbang'),
25-
labelWork: chalk.white.bold(' Work:'),
26-
labelTwitter: chalk.white.bold(' Twitter:'),
27-
labelGitHub: chalk.white.bold(' GitHub:'),
28-
labelLinkedIn: chalk.white.bold(' LinkedIn:'),
29-
labelWeb: chalk.white.bold(' Web:'),
30-
labelCard: chalk.white.bold(' Card:')
31-
}
32-
33-
// Actual strings we're going to output
3413
const newline = '\n'
35-
const heading = `${data.name} ${data.handle}`
36-
const working = `${data.labelWork} ${data.work}`
37-
const twittering = `${data.labelTwitter} ${data.twitter}`
38-
const githubing = `${data.labelGitHub} ${data.github}`
39-
const linkedining = `${data.labelLinkedIn} ${data.linkedin}`
40-
const webing = `${data.labelWeb} ${data.web}`
41-
const carding = `${data.labelCard} ${data.npx}`
14+
const formatLabel = value => chalk.white.bold(leftPad(value, 12) + ':')
15+
const formatLink = value => chalk.cyan(value)
16+
17+
const data = [
18+
{
19+
label: chalk.white.bold('Michael Stramel'),
20+
value: '',
21+
},
22+
{
23+
label: '',
24+
value:
25+
chalk.white('Software Engineer') +
26+
chalk.gray(' @ Coolfire Solutions') +
27+
newline,
28+
},
29+
{
30+
label: formatLabel('Twitter'),
31+
value: formatLink('https://twitter.com/stramel89'),
32+
},
33+
{
34+
label: formatLabel('GitHub'),
35+
value: formatLink('https://github.com/stramel'),
36+
},
37+
{
38+
label: formatLabel('LinkedIn'),
39+
value: formatLink('https://linkedin.com/in/stramel'),
40+
},
41+
{
42+
label: formatLabel('Website'),
43+
value: 'COMING SOON',
44+
},
45+
{
46+
label: newline + chalk.cyan(leftPad('$', 13)),
47+
value: chalk.white('npx stramel'),
48+
},
49+
]
4250

43-
// Put all our output together into a single variable so we can use boxen effectively
44-
const output = heading + newline + newline + working + newline + twittering + newline + githubing + newline + linkedining + newline + webing + newline + newline + carding
51+
const output = data
52+
.map(({ label, value }) => `${label}${label && ' '}${value}`)
53+
.join(newline)
4554

46-
console.log(chalk.green(boxen(output, options)))
55+
console.log(chalk.green(boxen(output, boxenOptions)))

0 commit comments

Comments
 (0)