file-size-check-cli
v1.0.0
Published
CLI tool to check file sizes and alert when they exceed thresholds
Maintainers
Readme
file-size-check-cli
CLI tool to scan files and directories, report sizes, and alert when files exceed a configured threshold.
Install
npm install -g file-size-check-cliUsage
# Check current directory
file-size-check
# Check specific path with 10MB threshold
file-size-check ./dist --threshold 10MB
# Recursive scan, sorted by size
file-size-check --recursive --sort
# Top 5 largest files
file-size-check --recursive --top 5
# JSON output for CI
file-size-check --json --recursive
# List all files with sizes
file-size-check -l -rOptions
| Flag | Description | Default |
|------|-------------|---------|
| -t, --threshold | Size threshold (500KB, 10MB, 1GB) | 1MB |
| -r, --recursive | Scan subdirectories | off |
| -u, --unit | Display unit: B, KB, MB, GB | auto |
| -s, --sort | Sort by size (largest first) | off |
| -n, --top <n> | Show top N files | all |
| -j, --json | JSON output | off |
| -l, --list | List all files | off |
Exit Codes
- 0 — No files exceed threshold
- 1 — One or more files exceed threshold
- 2 — Error
Use Case
Ideal for CI pipelines to catch bloated build artifacts, or for local cleanup of oversized files.
