word-counter-cli-kunal
v1.0.2
Published
Count words/specific-word in single or multiple files from CLI
Readme
🧮 Word Counter CLI
A simple Node.js CLI tool to count words in one or multiple text files. Optionally, you can also count the frequency of a specific word.
📦 Installation
npm install -g word-counter-cli-kunal🚀 Usage
Count all words in a file
word-counter <file-path>Example:
word-counter ./sample.txtCount all words from multiple files
word-counter <file1> <file2> ...Example:
word-counter ./a.txt ./b.txtCount a specific word
word-counter <file-path> <word>Example:
word-counter ./sample.txt hello📄 Example Output
word-counter sample.txt{
"hello": 3,
"world": 2,
"example": 1
}word-counter sample.txt hellohello: 3🛠 Features
✅ Count all words in one or more text files
✅ Count a specific word by providing it as an argument
✅ Cleans up special characters using regex
✅ Case-insensitive counting
✅ Works with Node.js fs/promises
👨💻 Author
Kunal Rathore
⚖️ License
This project is licensed under the MIT License.
