wcjs-cli
v1.0.2
Published
A CLI tool that counts total words in a file and provides the frequency of a specified word.
Maintainers
Readme
wcjs-cli
A simple and fast CLI word counter built with Node.js. It can count total words in a file and also report the frequency of a specified word.
✨ Features
- 📄 Count total words in a text file
- 🔍 Get frequency of a specific word
- ⚡ Lightweight and fast
- 🧰 Works as a global CLI or via
npx
📦 Installation
Global installation
npm install -g wcjs-cliUsing npx (no install required)
npx wcjs-cli filename.txt🚀 Usage
Count total words in a file
wcjs-cli file.txtOutput:
Words: 120Count frequency of a specific word
wcjs-cli file.txt helloOutput:
hello: 5🛠 Example
wcjs-cli article.txt javascriptThis command counts how many times the word "javascript" appears in article.txt.
📁 How it works
- Reads file content using Node.js
fsmodule - Splits text using whitespace
- Supports simple word matching
📌 Requirements
- Node.js v16 or later
📄 License
MIT License
👤 Author
Noor Ul Ain
