@asdsadw12312dwd2112xz/base64-encode-cli
v1.0.0
Published
Encode/decode Base64, hex, URL encoding from terminal
Maintainers
Readme
base64-encode-cli
Encode and decode Base64, hex, and URL encoding from the terminal.
Install
npm install -g base64-encode-cliUsage
# Base64
encode base64 "hello world" # aGVsbG8gd29ybGQ=
encode base64d "aGVsbG8gd29ybGQ=" # hello world
# Hex
encode hex "hello" # 68656c6c6f
encode hexd "68656c6c6f" # hello
# URL encoding
encode url "hello world & foo" # hello%20world%20%26%20foo
encode urld "hello%20world" # hello world
# Auto-detect (decode or encode all)
encode auto "aGVsbG8gd29ybGQ=" # detects Base64, decodes it
encode auto "hello world" # no encoding detected, shows all formats
# Encode a binary file to Base64
encode file image.png
# Read from stdin
echo "hello" | encode base64 --stdin
# Read from file
encode base64 -f input.txt
# Copy to clipboard
encode base64 "secret" --copy
# Write to file
encode hex "data" --output encoded.txtCommands
| Command | Description |
|-----------|----------------------------|
| base64 | Encode string to Base64 |
| base64d | Decode Base64 string |
| hex | Encode string to hex |
| hexd | Decode hex string |
| url | URL-encode a string |
| urld | URL-decode a string |
| auto | Auto-detect and decode/encode |
| file | Encode binary file to Base64 |
Options
| Option | Description |
|------------------|--------------------------|
| -f, --file | Read input from file |
| --stdin | Read input from stdin |
| --copy | Copy result to clipboard |
| --output <path>| Write result to file |
License
MIT
