Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jstrace/bars
Ascii bar charting for nodejs
https://github.com/jstrace/bars
Last synced: 9 days ago
JSON representation
Ascii bar charting for nodejs
- Host: GitHub
- URL: https://github.com/jstrace/bars
- Owner: jstrace
- Created: 2014-02-27T03:06:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-01-09T06:15:29.000Z (almost 7 years ago)
- Last Synced: 2024-10-13T13:21:45.885Z (30 days ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 123
- Watchers: 4
- Forks: 56
- Open Issues: 3
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# Bars
Ascii bar charting for node.
```
cats | ######################## | 6
ferrets | ############################################################ | 15
dogs | ######## | 2
koalas | | 0dogs | ==================== | 30
ferrets | ============= | 20
cats | ======== | 12
koalas | == | 3/data | ******************** | 150gb
/srv | * | 5gb
/etc | | 150mb
```## Installation
```
$ npm install jstrace/bars
```## Example
```js
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