ts-wc
is a simple command-line utility written in TypeScript for counting bytes, lines, words, and characters in text files.
Follow the steps below to get started:
-
Clone the repository using Git:
git clone https://github.com/Mayank2808sharma/ts-wc
-
Change to the project directory:
cd ts-wc
-
Install the Packages:
npm i
-
Compile the TS File:
ts -b
node [compiledFileName] [flags] [filename]
Flags:
-c Outputs the numbers of bytes in the file
-h help for ts-wc
-l Outputs the numbers of lines in the file
-m Outputs the numbers of characters in the file
-w Outputs the numbers of words in the file
By default, ts-wc outputs the number of words, lines, bytes, and characters for the file.
node dist/main.js -w test.txt