give-em-hell
Version:
Give 'Em Hell: Find and count em dashes, en dashes, and hyphens in your codebase
89 lines (64 loc) ⢠2.22 kB
Markdown
# Give 'Em Hell š„
Find and count em dashes (ā), en dashes (ā), and hyphens (-) in your codebase.
## Installation
```bash
npm install -g give-em-hell
```
Or use directly with npx (no install needed):
```bash
npx give-em-hell
```
## Usage
```bash
# Scan current directory
give-em-hell
# Scan specific directory
give-em-hell /path/to/your/project
# Use with npx
npx give-em-hell /path/to/your/project
```
## Output Example
```
š Scanning for dashes in: /Users/you/project
ā³ Files processed: 150 | Skipped: 12 | Errors: 0
š Dash Statistics:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Em Dash (ā): 253
En Dash (ā): 23,452
Hyphen (-): 352
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Total: 24,057
š Files processed: 150
āļø Files skipped: 12
ā±ļø Time taken: 2.34s
```
## Features
- **Memory Efficient**: Streams files instead of loading them entirely into memory
- **Smart Filtering**: Automatically skips binary files and common non-code directories
- **Progress Tracking**: Real-time progress updates for large codebases
- **Safe Defaults**: 10MB file size limit and 50-level recursion depth limit
- **Error Resilient**: Continues processing even when individual files fail
## What Gets Scanned
### Included File Types
`.js`, `.jsx`, `.ts`, `.tsx`, `.py`, `.java`, `.c`, `.cpp`, `.h`, `.hpp`, `.cs`, `.rb`, `.go`, `.rs`, `.swift`, `.kt`, `.php`, `.html`, `.css`, `.scss`, `.sass`, `.less`, `.vue`, `.svelte`, `.md`, `.txt`, `.json`, `.xml`, `.yaml`, `.yml`
### Excluded Directories
- `node_modules`
- `.git`
- `dist`
- `build`
- `coverage`
- `.next`
- `.cache`
- `vendor`
- `bower_components`
- Hidden directories (starting with `.`)
## Why?
Typography matters! This tool helps you:
- Ensure consistency in dash usage across your codebase
- Find accidental em/en dash usage in code
- Audit documentation and comments for proper dash usage
- Have fun with typography statistics
## License
MIT Ā© mlot.ai
## Contributing
Issues and PRs welcome at [github.com/incrediblecrab/give-em-hell](https://github.com/incrediblecrab/give-em-hell)