-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tierney Cyren <[email protected]>
- Loading branch information
Showing
4 changed files
with
115 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/env node | ||
// 👆 Used to tell Node.js that this is a CLI tool | ||
|
||
import { readFileSync } from 'node:fs' | ||
import { join } from 'node:path' | ||
import { readFileSync } from 'node:fs'; | ||
import { join } from 'node:path'; | ||
|
||
const output = readFileSync(join(import.meta.dirname, 'output'), 'utf8') | ||
console.log(output) | ||
const output = readFileSync(join(import.meta.dirname, 'output'), 'utf8'); | ||
console.log(output); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.6.1/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "single" | ||
} | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,74 @@ | ||
// Pull in our modules | ||
import chalk from 'chalk' | ||
import boxen from 'boxen' | ||
import { writeFileSync } from 'node:fs' | ||
import { join } from 'node:path' | ||
import chalk from 'chalk'; | ||
import boxen from 'boxen'; | ||
import { writeFileSync } from 'node:fs'; | ||
import { join } from 'node:path'; | ||
|
||
// Define options for Boxen | ||
const options = { | ||
padding: 1, | ||
margin: 1, | ||
borderStyle: 'round' | ||
} | ||
padding: 1, | ||
margin: 1, | ||
borderStyle: 'round', | ||
}; | ||
|
||
// Text + chalk definitions | ||
const data = { | ||
name: chalk.white(' Tierney Cyren'), | ||
handle: chalk.white('bitandbang'), | ||
shorthandle: chalk.white('bnb'), | ||
work: chalk.white('Principal Developer Advocate at Twilio (::)'), | ||
twitter: chalk.gray('https://twitter.com/') + chalk.cyan('bitandbang'), | ||
mastodon: chalk.gray('https://mastodon.social/') + chalk.magenta('@bnb'), | ||
npm: chalk.gray('https://npmjs.com/') + chalk.red('~bnb'), | ||
github: chalk.gray('https://github.com/') + chalk.green('bnb'), | ||
linkedin: chalk.gray('https://linkedin.com/in/') + chalk.blue('bitandbang'), | ||
web: chalk.cyan('https://bnb.im'), | ||
npx: `${chalk.red('npx')} ${chalk.white('bitandbang')}`, | ||
labelWork: chalk.white.bold(' Work:'), | ||
labelTwitter: chalk.white.bold(' Twitter:'), | ||
labelMastodon: chalk.white.bold('Mastodon:'), | ||
labelnpm: chalk.white.bold(' npm:'), | ||
labelGitHub: chalk.white.bold(' GitHub:'), | ||
labelLinkedIn: chalk.white.bold('LinkedIn:'), | ||
labelWeb: chalk.white.bold(' Web:'), | ||
labelCard: chalk.white.bold(' Card:') | ||
} | ||
name: chalk.white(' Tierney Cyren'), | ||
handle: chalk.white('bitandbang'), | ||
shorthandle: chalk.white('bnb'), | ||
work: chalk.white('Principal Developer Advocate at Twilio (::)'), | ||
twitter: chalk.gray('https://twitter.com/') + chalk.cyan('bitandbang'), | ||
mastodon: chalk.gray('https://mastodon.social/') + chalk.magenta('@bnb'), | ||
npm: chalk.gray('https://npmjs.com/') + chalk.red('~bnb'), | ||
github: chalk.gray('https://github.com/') + chalk.green('bnb'), | ||
linkedin: chalk.gray('https://linkedin.com/in/') + chalk.blue('bitandbang'), | ||
web: chalk.cyan('https://bnb.im'), | ||
npx: `${chalk.red('npx')} ${chalk.white('bitandbang')}`, | ||
labelWork: chalk.white.bold(' Work:'), | ||
labelTwitter: chalk.white.bold(' Twitter:'), | ||
labelMastodon: chalk.white.bold('Mastodon:'), | ||
labelnpm: chalk.white.bold(' npm:'), | ||
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} / ${data.shorthandle}` | ||
const working = `${data.labelWork} ${data.work}` | ||
const twittering = `${data.labelTwitter} ${data.twitter}` | ||
const mastodoning = `${data.labelMastodon} ${data.mastodon}` | ||
const npming = `${data.labelnpm} ${data.npm}` | ||
const githubing = `${data.labelGitHub} ${data.github}` | ||
const linkedining = `${data.labelLinkedIn} ${data.linkedin}` | ||
const webing = `${data.labelWeb} ${data.web}` | ||
const carding = `${data.labelCard} ${data.npx}` | ||
const newline = '\n'; | ||
const heading = `${data.name} / ${data.handle} / ${data.shorthandle}`; | ||
const working = `${data.labelWork} ${data.work}`; | ||
const twittering = `${data.labelTwitter} ${data.twitter}`; | ||
const mastodoning = `${data.labelMastodon} ${data.mastodon}`; | ||
const npming = `${data.labelnpm} ${data.npm}`; | ||
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 | ||
twittering + newline + // data.labelTwitter + data.twitter | ||
mastodoning + newline + // data.labelTwitter + data.twitter | ||
npming + newline + // data.labelnpm + data.npm | ||
githubing + newline + // data.labelGitHub + data.github | ||
linkedining + newline + // data.labelLinkedIn + data.linkedin | ||
webing + newline + newline + // data.labelWeb + data.web | ||
carding // data.labelCard + data.npx | ||
const output = | ||
heading + // data.name + data.handle | ||
newline + | ||
newline + // Add one whole blank line | ||
working + | ||
newline + // data.labelWork + data.work | ||
twittering + | ||
newline + // data.labelTwitter + data.twitter | ||
mastodoning + | ||
newline + // data.labelTwitter + data.twitter | ||
npming + | ||
newline + // data.labelnpm + data.npm | ||
githubing + | ||
newline + // data.labelGitHub + data.github | ||
linkedining + | ||
newline + // data.labelLinkedIn + data.linkedin | ||
webing + | ||
newline + | ||
newline + // data.labelWeb + data.web | ||
carding; // data.labelCard + data.npx | ||
|
||
writeFileSync(join(import.meta.dirname, 'bin/output'), chalk.green(boxen(output, options))) | ||
writeFileSync( | ||
join(import.meta.dirname, 'bin/output'), | ||
chalk.green(boxen(output, options)), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,34 @@ | ||
{ | ||
"name": "bitandbang", | ||
"version": "4.0.0", | ||
"description": "A personal card for Tierney Cyren (@bitandbang)", | ||
"main": "/bin/card.mjs", | ||
"bin": { | ||
"bitandbang": "./bin/card.mjs" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/bnb/bitandbang.git" | ||
}, | ||
"homepage": "https://bnb.im", | ||
"scripts": { | ||
"prepublish": "npm run build", | ||
"build": "node build.mjs", | ||
"dev": "npm run build && node ./bin/card.mjs", | ||
"lint": "standard" | ||
}, | ||
"keywords": [ | ||
"card", | ||
"npm", | ||
"npm card", | ||
"npx", | ||
"npx card", | ||
"business card" | ||
], | ||
"author": "Tierney Cyren <[email protected]> (http://bnb.im)", | ||
"license": "MIT", | ||
"files": [ | ||
"bin/card.mjs", | ||
"bin/output" | ||
], | ||
"devDependencies": { | ||
"boxen": "^7.1.1", | ||
"chalk": "^5.3.0", | ||
"standard": "^17.1.0" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/bnb/bitandbang/issues" | ||
}, | ||
"dependencies": {} | ||
"name": "bitandbang", | ||
"version": "4.0.0", | ||
"description": "A personal card for Tierney Cyren (@bitandbang)", | ||
"main": "/bin/card.mjs", | ||
"bin": { | ||
"bitandbang": "./bin/card.mjs" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/bnb/bitandbang.git" | ||
}, | ||
"homepage": "https://bnb.im", | ||
"scripts": { | ||
"prepublish": "npm run build", | ||
"build": "node build.mjs", | ||
"dev": "npm run build && node ./bin/card.mjs", | ||
"format": "npx @biomejs/biome format --write", | ||
"lint": "npx @biomejs/biome lint --write", | ||
"check": "npx @biomejs/biome check --write" | ||
}, | ||
"keywords": ["card", "npm", "npm card", "npx", "npx card", "business card"], | ||
"author": "Tierney Cyren <[email protected]> (http://bnb.im)", | ||
"license": "MIT", | ||
"files": ["bin/card.mjs", "bin/output"], | ||
"devDependencies": { | ||
"@biomejs/biome": "1.8.2", | ||
"boxen": "^7.1.1", | ||
"chalk": "^5.3.0" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/bnb/bitandbang/issues" | ||
} | ||
} |