-
-
Save m1guelpf/64b6117d81b3e65a67dbacb69f3e2796 to your computer and use it in GitHub Desktop.
Transmission11s Style Headers In Node
This file contains hidden or 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
#!/usr/bin/env node | |
import { execSync } from 'child_process' | |
const args = process.argv.slice(2); | |
if (args.length !== 1) { | |
throw new Error(`Invalid argument count ${args.length} expected 1`); | |
} | |
const word = args[0]; | |
const header = ` /*////////////////////////////////////////////////////////////// | |
${' '.repeat((64 - word.length) / 2)}${word.toUpperCase()} | |
//////////////////////////////////////////////////////////////*/`; | |
console.log(header); | |
execSync(`echo "${header}" | pbcopy`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment