@kszongic/histogram-cli
v1.0.0
Published
Render text histograms from numbers on stdin
Maintainers
Readme
@kszongic/histogram-cli
Render text histograms from numbers on stdin. Zero dependencies.
Install
npm i -g @kszongic/histogram-cliUsage
# Basic histogram from sequential numbers
seq 100 | histogram
# Space-separated input with custom bins
echo "1 2 2 3 3 3 4 4 4 4" | histogram --bins 4
# Read from file with custom width and character
cat data.txt | histogram -w 60 -c '#'Options
| Flag | Description | Default |
|------|-------------|---------|
| -b, --bins <n> | Number of bins | 10 |
| -w, --width <n> | Max bar width in chars | 40 |
| -c, --char <ch> | Bar character | █ |
| -h, --help | Show help | |
| -v, --version | Show version | |
Example Output
[1.000, 1.750) | ██████████ 1
[1.750, 2.500) | ████████████████████ 2
[2.500, 3.250) | ██████████████████████████████ 3
[3.250, 4.000) | ████████████████████████████████████████ 4
n=10 min=1 max=4 bins=4License
MIT
