Skip to content

utalmighty/AC-JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4c1948a ยท Feb 13, 2024

History

39 Commits
Jan 22, 2024
Jan 22, 2024
Feb 13, 2024
Jan 22, 2024
Jan 22, 2024

Repository files navigation

Advance CAT commands

Installation๐Ÿ’ป

npm install

General Syntax:

node cat [options] [filepaths] [key]

option to remove big line break (-s)
option to add line number to non empty lines (-b)
option to add line numbers to all lines (-n)
option to encrypt the file (-e) (AES-128 bit)
option to decrypt the file (-de) (AES-128 bit)
option to compress the file (-c)
option to decompress the file (-d)
option to create new file (-touch)
option to view tree structure of directory (-tree)

Commands:

1- node cat <filepath> => displays content of the file in the terminal ๐Ÿ—„
2- node cat <filepath1 filepath2 filepath3...> => displays content of all files in the terminal in (concatenated form) in the given order. ๐Ÿ—ƒ
3- node cat -s <filepath> => convert big line breaks into a singular line break ๐Ÿ“œ
4- node cat -n <filepath> => give numbering to all the lines ๐Ÿ”ข
5- node cat -b <filepath> => give numbering to non-empty lines ๐Ÿ”ข๐Ÿ“œ
6- node cat -e <filepath> <key> => encrypt file with Military Grade(AES-128) bit encryption ๐Ÿ”’
7- node cat -de <filepath> <key> => decrypt file with Military Grade(AES-128) bit encryption ๐Ÿ”“
8- node cat -c <filepath> => Compresses the text based file using Huffman Coding ๐Ÿ—œ
9- node cat -d <filepath> => Decompresses file compressed file ๐Ÿ—„
10- node cat -touch <filepath> => Creates new file/folder at the specified path ๐Ÿ†•
11- node cat -tree <filepath> => Draws the path tree ๐ŸŒณ
12- We can mix and match some of the options.

Edge cases:

1- If file entered is not found then it gives file does not exist error.
2- -n and -b are 2 options which are mutually exclusive so if user types both of them together only the first enter option should work.
3- -s and any or both -n and -b present then -s will be executed first and then -n and -b according second rule.
4- Advanced options like encryption/decryption can not be mixed matched.
5- For Encryption and decryption 16 character (128 bit) key is required.
6- Compression is done using Huffman coding.
7- Can only decompress file which is compressed using this software only.
8- Touch command can create new folder or files.
9- filepath in tree command is optional.

Compression:

Before Compression: Before Compression

After Compression: After Compression