{"id":16102731,"url":"https://github.com/icyflame/bar-horizontal","last_synced_at":"2025-03-16T08:32:30.277Z","repository":{"id":34149842,"uuid":"37987683","full_name":"icyflame/bar-horizontal","owner":"icyflame","description":"Create beautiful horizontal charts, that fit your terminal.","archived":false,"fork":false,"pushed_at":"2022-12-30T20:01:48.000Z","size":156,"stargazers_count":38,"open_issues_count":8,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T05:55:57.733Z","etag":null,"topics":["beautiful-horizontal-charts","chart","labels","module","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icyflame.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-24T13:58:39.000Z","updated_at":"2024-02-02T06:18:40.000Z","dependencies_parsed_at":"2023-01-15T04:55:30.345Z","dependency_job_id":null,"html_url":"https://github.com/icyflame/bar-horizontal","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyflame%2Fbar-horizontal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyflame%2Fbar-horizontal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyflame%2Fbar-horizontal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icyflame%2Fbar-horizontal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icyflame","download_url":"https://codeload.github.com/icyflame/bar-horizontal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806071,"owners_count":20350775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beautiful-horizontal-charts","chart","labels","module","nodejs"],"created_at":"2024-10-09T18:54:33.408Z","updated_at":"2025-03-16T08:32:29.946Z","avatar_url":"https://github.com/icyflame.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bar-horizontal [![Build Status](https://travis-ci.org/icyflame/bar-horizontal.svg?branch=master)](https://travis-ci.org/icyflame/bar-horizontal)\n\n\u003e Create beautiful horizontal charts, that fit your terminal.\n\n\n## Install\n\n```\n$ npm install --save bar-horizontal\n```\n\n\n## Usage\n\n```js\nvar barHorizontal = require('bar-horizontal');\nbarHorizontal([6, 5, 4, 3, 2]);\n// =\u003e Prints this on the console :-\n: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 30%\n: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 25%\n: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 20%\n: ▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 15%\n: ▇▇▇▇▇▇▇▇▇ 10%\n\n\ninput_obj = {\n  'first task': 20,\n  'second task': 40,\n  'a really really long label!': 90,\n  'short one': 20\n};\n\nbarHorizontal(input_obj, {labels: true});\n// =\u003e Prints this on the console :-\nfirst task                  : ▇▇▇▇ 12%\nsecond task                 : ▇▇▇▇▇▇▇▇▇ 24%\na really really long label! : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 53%\nshort one                   : ▇▇▇▇ 12%\n```\n\n\n## CLI\n\n```\n$ npm install --global bar-horizontal\n```\n```\n\n  Create beautiful horizontal charts, that fit your terminal.\n\n  Usage\n    $ bar-horizontal input-array\n    $ bar-horizontal input-array --values\n\n  Examples\n    $ bar-horizontal 1 2 3 4\n     : ▇▇▇▇▇▇▇▇ 10%\n     : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 20%\n     : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 30%\n     : ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 40%\n\n    $ bar-horizontal 1 2 3 4 --ascii \n     : ======  10.00%\n     : =============  20.00%\n     : ====================  30.00%\n     : ===========================  40.00%\n```\n\n\n## API\n\n### barHorizontal(input_obj, [options])\n\n#### input_obj\n\n*Required*  \nType: `Array of Numbers`  \nThe array whose bar chart will be created.\n\n#### options\n\n##### labels\n\n*Optional*  \nType: `Boolean`  \nDefault: `false`  \nLabels to be shown or not\n\n##### warnings\n\n*Optional*  \nType: `Boolean`  \nDefault: `false`  \nWhether or not to show warnings (eg. 'missing/invalid input')\n\n##### ascii\n\n*Optional*  \nType: `Boolean`  \nDefault: `false`  \nWhether or not to use the `=` when printing the bar graph(s) to stdout.\n\nBy default, this module will use the\n[square](https://github.com/sindresorhus/figures/blob/dfeeb1c1733a9fe6f6b13d25f37c440ba6750c0e/index.js#L10)\ncharacter from [figures](https://www.npmjs.com/package/figures).\n\n##### width\n\n*Optional*  \nType: `Number`  \nDefault: The width of the present terminal  \nIf supplied, the printed bar graph will look good on a terminal of the supplied\nwidth's length.\n\n\n##### noPrint\n\n*Optional*  \nType: `Boolean`  \nDefault: `false`  \nWhether `barHorizontal` should print the results to the console or not. If\n`noPrint` is set, then the function will return the string and print nothing to\nthe console\n\n## Testing\nThis module uses the [mocha](https://mochajs.org/) test framework. The test suite can be run by invoking `npm test` from the root directory.\n\n## License\n\nMIT © [Siddharth Kannan](http://icyflame.github.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficyflame%2Fbar-horizontal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficyflame%2Fbar-horizontal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficyflame%2Fbar-horizontal/lists"}