CLI tool that will encode and decode a text by Caesar cipher.
CLI tool could accept 4 options (short alias and full name):
- -a, --action: an action encode/decode
- -s, --shift: a shift
- -i, --input: an input file
- -o, --output: an output file
- For encoding/decoding using only the English alphabet, all other characters will be kept untouched.
- Action (encode/decode) and the shift (integer) are required
- If the input file is missed - stdin will be used as an input source.
- If the output file is missed - stdout will be used as an output destination.
- If passed params are fine, the output (file or stdout) will contain encoded/decoded content of input (file or stdin).
CLI tool requires Node.js v12+
Install the dependencies.
cd caesar-cipher-cli
npm install
node index -a encode -s 7 -i ./files/input.txt -o ./files/output.txt
node index --action encode --shift 5 --input "./files/input.txt" --output "./files/output.txt"
node index --action decode --shift 5 --input "./files/input.txt" --output "./files/output.txt"
input.txt:
“Code never lies; comments sometimes do.” — Ron Jeffries
output.txt:
“Htij sjajw qnjx; htrrjsyx xtrjynrjx it.” — Wts Ojkkwnjx
CLI tool uses a number of open source projects to work properly:
- node.js - evented I/O for the backend
- minimist - great cli argument parser
Copyright (c) 2020, Pavel V.