lexistats
v1.0.1
Published
A simple Node.js CLI tool to analyze text files and print summary and detailed statistics.
Maintainers
Readme
lexistats
Simple Node.js CLI tool that analyzes a text file and prints summary and optional detailed statistics.
Installation
npm install -g lexistatsFeatures
- Basic file statistics (size, characters, words, lines)
- Detailed analysis (non-whitespace chars, paragraphs, word length)
- Most common words detection
- Human-readable file size formatting
Usage
After installing globally, run:
lexistats <file.txt> [options]Options:
-h,--help— show help-d,--detail— show detailed statistics (non-whitespace chars, paragraphs, average word length, common words)
Examples:
# Basic summary
lexistats sample.txt
# Detailed report
lexistats sample.txt --detailOutput
Summary includes:
- File name and formatted size
- Characters, words, lines
Detailed (when --detail):
- Non-whitespace characters
- Paragraph count
- Average word length
- Top 10 most common words
Requirements
- Node.js (v12+ recommended)
Notes
- The CLI expects a
.txtfile and will exit with an error for other extensions - File existence and read errors are properly handled
Contributing
Open an issue or PR on GitHub with improvements or bug fixes.
License
MIT
Author
Muhammad Ramshad
