Bars
Ascii bar charting for nodejs
Install / Use
/learn @jstrace/BarsREADME
Bars
Ascii bar charting for node.
cats | ######################## | 6
ferrets | ############################################################ | 15
dogs | ######## | 2
koalas | | 0
dogs | ==================== | 30
ferrets | ============= | 20
cats | ======== | 12
koalas | == | 3
/data | ******************** | 150gb
/srv | * | 5gb
/etc | | 150mb
Installation
$ npm install jstrace/bars
Example
var bars = require('bars');
var bytes = require('bytes');
var data = {
cats: 6,
ferrets: 15,
dogs: 2,
koalas: 0
};
console.log();
console.log(bars(data));
// customized
var data = {
ferrets: 20,
cats: 12,
dogs: 30,
koalas: 3
};
console.log();
console.log(bars(data, { bar: '=', width: 20, sort: true }));
// value mapping
var data = {
'/srv': bytes('5gb'),
'/data': bytes('150gb'),
'/etc': bytes('150mb')
};
console.log();
console.log(bars(data, { bar: '*', width: 20, sort: true, map: bytes }));
License
MIT
Related Skills
node-connect
333.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
82.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
333.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
82.0kCommit, push, and open a PR
