nodcat
v1.1.0
Published
This Node.js script mimics the `cat` command in Linux, allowing you to read from a file or standard input and print the output with colored text. You can read larger file content without any problem even 10gb or larger ๐
Downloads
13
Readme
Linux Cat Commad Clone Using Raw Node.js
This Node.js script mimics the cat
command in Linux, allowing you to read from a file or standard input and print the output with colored text.
You can read larger file content without any problem even 10gb or larger ๐
Features
- Reads from a file and outputs the content to the console.
- Colors the output text using ANSI escape codes.
- Converts stdin input to uppercase and colors it before printing.
- Allows changing the file path dynamically by entering
path:<filePath>
.
you can install using npm also.
npm i nodcat
Usage if you install with npm
if you install it globally or locally then you can simply
use nodcat <pathname>
or
nodcat
path:<filename> like ./learning.c
Installation
Clone the repository:
git clone https://github.com/omorhawlader/CLI-using-nodejs-linux-cat-command-clone-with-extra-
cd node-cat-command
Install dependencies
npm install
Usage
1.Run the script with a file path as an argument:
node cat.js <filePath>
Example:
node cat.js example.txt
2.Run the script and provide input via stdin:
node cat.js
Type the text and press Enter to see the colored uppercase output.
- Change the file path dynamically:
node cat.js
Enter path: to read from a new file.
Example
1.Reading from a file:
node cat.js example.txt
- Using stdin:
node cat.js
Input:
omar
Output:
OMAR
3.Changing file path dynamically:
node cat.js
Input:
path:example.txt