1.1.0 • Published 1 year ago
nodcat v1.1.0
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.cInstallation
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.txt2.Run the script and provide input via stdin:
node cat.jsType the text and press Enter to see the colored uppercase output.
- Change the file path dynamically:
node cat.jsEnter path: to read from a new file.
Example
1.Reading from a file:
node cat.js example.txt- Using stdin:
node cat.jsInput:
omarOutput:
OMAR3.Changing file path dynamically:
node cat.jsInput:
path:example.txt