@kunalkhandekar.dev/word-counter-cli
v1.1.0
Published
A simple CLI to count words in a text file
Readme
@kunalkhandekar.dev/word-counter-cli
A simple Node.js CLI tool to count words in a text file. Optionally, you can also count the frequency of a specific word.
📦 Installation
npm install -g @kunalkhandekar.dev/word-counter-cli🚀 Usage
Count all words in a file
word-counter-cli <file-path>Example:
word-counter-cli ./sample.txtCount a specific word
word-counter-cli <file-path> <word>Example:
word-counter-cli ./sample.txt hello📄 Example Output
word-counter-cli sample.txt{
"hello": 3,
"world": 2,
"example": 1
}word-counter-cli sample.txt hellohello = 3🛠 Features
- ✅ Count all words in a text file
- ✅ Count a specific word by providing a second argument
- ✅ Cleans up special characters and handles line breaks
- ✅ Case-insensitive counting
🧑💻 Author
Sahil Khandekar
📦 NPM
