CLI tool for node.js that will encode and decode a text by Caesar cipher. RS School task.
my_caesar_cli
│
├─ caesar-modules
│ ├─ codec.js
│ └─ files-io.js
├─ caesar.js
├─ decode-test.txt
└─ encode-test.txt
Entry:
./caesar.js
- if passed params are fine the output (file or stdout) should contain encoded/decoded content of input (file or stdin).
- if the input file is missed - App use stdin as an input source.
- if the output file is missed - App use stdout as an output destination.
- if the input and/or output file is given but doesn't exist or can't read it (e.g. because of permissions or it is a directory) - you'll get the error message.
- This app use only the English alphabet
Clone or download this repository for use CLI App on your computer.
For installation modules:
npm i
For start use:
$ node caeser.js --shift <shift: is number> --action <action: encode || decode> [--input <string: file name || STDIO>] [--output <string: file name || STDOUT>]
Options:
- -s, --shift: a shift (requered option)
- -i, --input: an input file (requered option)
- -o, --output: an output file
- -a, --action: an action encode/decode
Use:
$ node caesar.js -s 7 -a encode --input encode-test.txt
Your shift is 7 and you choice action is encode
encode-test.txt
Aopz pz zljyla. Tlzzhnl hivba "_" zftivs!
$ node caesar.js -s 7 -a decode --input decode-test.txt
Your shift is 7 and you choice action is decode
decode-test.txt
This is secret. Message about "_" symbol!
Thank you for attention
Grazie per l'attenzione.
Ilya Lokalin (@ILokalin) in Discorde
or LI#4947
https://t.me/IlyaLokalin in Telegram