node-histo
install
$ npm install histo
usage
All Histo
instances are Writable
streams. Only one histo stream may
be enabled at a time. You can swap between histo streams with
#enable()
which will clean up the terminal view and render the enabled
histo stream.
The following program:
var histo = ; var a = ; a;;
Could yield something like this:
█
973 ․ █
█ █
917 ․ █ █ █
█ █ █
862 ․ █ █ █ █
█ █ █ █
806 ․ █ █ █ █
█ █ █ █
751 ․ █ █ █ █
█ █ █ █ █
695 ․ █ █ █ █ █ █
█ █ █ █ █ █
639 ․ █ █ █ █ █ █ █
█ █ █ █ █ █ █
584 ․ █ █ █ █ █ █ █
█ █ █ █ █ █ █
528 ․ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █
473 ․ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █
417 ․ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █
361 ․ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █
306 ․ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █
250 ․ █ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █ █ █
195 ․ █ █ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █ █ █ █ █
139 ․ █ █ █ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █ █ █ █ █ █
83 ․ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █ █ █ █ █ █
28 ․ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․ ․
api
Same as through
All control flow can be controlled with .pause()
and .resume()
. To
enable into view, use .enable()
.
histo(values)
values
- An array of initial values to be wrtten to the stream
var h = ;
#enable
Enable the stream to be rendered into view.
h;
license
MIT