๐Ÿ“ฆ antongolub / credebug

CLI to check if some credential value is defined or not. Not safe for production usage.

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ MIT License
debug
๐Ÿ“ฅ Clone https://github.com/antongolub/credebug.git
HTTPS git clone https://github.com/antongolub/credebug.git
SSH git clone git@github.com:antongolub/credebug.git
CLI gh repo clone antongolub/credebug
Anton Golub Anton Golub chore: formatting 084cc84 2 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ CHANGELOG.md
๐Ÿ“„ LICENSE
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ README.md

credebug

Release Maintainability Test Coverage

Strange things happen sometimes. Imagine, you're using a tool that relies on environment variables and cred arguments, but doesn't assert them, and falls apart for no reason. This snippet helps to debug misconfiguration.

#### โš ๏ธ Warning
Do not use this tool in production. It's just a proof of concept.
Write your own implementation and put it in a repository you can trust.

Usage

npx credebug --test='t' foo bar --baz --qux=quux --oopsIputMyPass0rdHere='t' --asv00124 --a --b --c=c --d d
test: ***
baz: <empty>
qux: ***
***: ***
***: <empty>
a: <empty>
b: <empty>
c: ***
d: ***
The script works like assert: if some target option is <empty> it returns error code 1. If no option is provided, it will check all environment variables.

npx credebug
PATH: ***
npm_package_json: ***
_: ***
npm_config_userconfig: ***
npm_config_init_module: ***
npm_command: ***

A slightly safer usage way. At least you can see the script code before running.

node -e 'let entries=process.argv.map(((t,e,s)=>{if(!t.startsWith("--"))return;const[r,n]=t.slice(2).split("=");return[r,n||s[e+1]&&!s[e+1]?.startsWith("--")]})).filter(Boolean);entries.length||(entries=Object.entries(process.env));let status=0;const result=entries.reduce(((t,[e,s])=>{const r=s?"***":"<empty>",n=/^[a-zA-Z_]+$/.test(e)?e:"***";return s||(status=1),`${t}\n${n}: ${r}`}),"");console.log(result),process.exit(status);' -- --test='t' foo bar --baz --qux=quux --oopsIputMyPass0rdHere='t' --asv00124 --a --b --c=c --d d

License

MIT