{"_id":"cli-tableau","_rev":"2770384","name":"cli-tableau","description":"Pretty unicode tables for the CLI","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"tknew","email":"strzelewicz.alexandre@gmail.com"}],"time":{"modified":"2022-05-23T09:38:52.000Z","created":"2020-04-19T09:52:48.292Z","2.0.1":"2020-06-15T11:21:49.356Z","2.0.0":"2020-04-19T09:52:48.292Z"},"users":{},"author":{"name":"Guillermo Rauch","email":"guillermo@learnboost.com"},"repository":{"type":"git","url":"git+https://github.com/Keymetrics/cli-table.git"},"versions":{"2.0.1":{"name":"cli-tableau","description":"Pretty unicode tables for the CLI","version":"2.0.1","engines":{"node":">=8.10.0"},"author":{"name":"Guillermo Rauch","email":"guillermo@learnboost.com"},"contributors":[{"name":"Sonny Michaud","email":"Michaud.sonny@gmail.com"}],"maintainers":[{"name":"tknew","email":"strzelewicz.alexandre@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/Keymetrics/cli-table.git"},"keywords":["cli","colors","table"],"dependencies":{"chalk":"3.0.0"},"devDependencies":{"should":"~0.6","mocha":"^7.1.1"},"main":"lib","scripts":{"test":"mocha test/*"},"licence":"MIT","gitHead":"a367ed7b86ff499f6649d3efdb88cade7c757f61","bugs":{"url":"https://github.com/Keymetrics/cli-table/issues"},"homepage":"https://github.com/Keymetrics/cli-table#readme","_id":"cli-tableau@2.0.1","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"shasum":"baa78d83e08a2d7ab79b7dad9406f0254977053f","size":6371,"noattachment":false,"key":"/cli-tableau/-/cli-tableau-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-tableau/download/cli-tableau-2.0.1.tgz"},"_npmUser":{"name":"tknew","email":"strzelewicz.alexandre@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-tableau_2.0.1_1592220109176_0.3860786501286484"},"_hasShrinkwrap":false,"publish_time":1592220109356,"_cnpm_publish_time":1592220109356,"_cnpmcore_publish_time":"2021-12-17T00:32:04.464Z"},"2.0.0":{"name":"cli-tableau","description":"Pretty unicode tables for the CLI","version":"2.0.0","engines":{"node":">=8.10.0"},"author":{"name":"Guillermo Rauch","email":"guillermo@learnboost.com"},"contributors":[{"name":"Sonny Michaud","email":"Michaud.sonny@gmail.com"}],"maintainers":[{"name":"tknew","email":"strzelewicz.alexandre@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/Keymetrics/cli-table.git"},"keywords":["cli","colors","table"],"dependencies":{"chalk":"3.0.0","mocha":"^7.1.1"},"devDependencies":{"should":"~0.6"},"main":"lib","scripts":{"test":"mocha test/*"},"licence":"MIT","gitHead":"f765bf49b48655b0f518ff53b9637d183b0e6ecb","bugs":{"url":"https://github.com/Keymetrics/cli-table/issues"},"homepage":"https://github.com/Keymetrics/cli-table#readme","_id":"cli-tableau@2.0.0","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"shasum":"0d156115011d1f4112baa40994c60de6fcf21e4d","size":6329,"noattachment":false,"key":"/cli-tableau/-/cli-tableau-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/cli-tableau/download/cli-tableau-2.0.0.tgz"},"_npmUser":{"name":"tknew","email":"strzelewicz.alexandre@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cli-tableau_2.0.0_1587289968043_0.6177130696136166"},"_hasShrinkwrap":false,"publish_time":1587289968292,"_cnpm_publish_time":1587289968292,"_cnpmcore_publish_time":"2021-12-17T00:32:04.696Z"}},"readme":"\n# cli tableau\n\n<a href=\"https://travis-ci.org/github/keymetrics/cli-tableau\" title=\"PM2 Tests\">\n  <img src=\"https://travis-ci.org/keymetrics/cli-tableau.svg?branch=master\" alt=\"Build Status\"/>\n</a>\n\n\n### Horizontal Tables\n```javascript\nvar Table = require('cli-tableau');\n\nvar table = new Table({\n    head: ['TH 1 label', 'TH 2 label'],\n    colWidths: [100, 200],\n    borders: false\n});\n\ntable.push(\n    ['First value', 'Second value'],\n    ['First value', 'Second value']\n);\n\nconsole.log(table.toString());\n```\n\n### Vertical Tables\n\n```javascript\nvar Table = require('cli-tableau');\nvar table = new Table();\n\ntable.push(\n    { 'Some key': 'Some value' },\n    { 'Another key': 'Another value' }\n);\n\nconsole.log(table.toString());\n```\n\n### Cross Tables\nCross tables are very similar to vertical tables, with two key differences:\n\n1. They require a `head` setting when instantiated that has an empty string as the first header\n2. The individual rows take the general form of { \"Header\": [\"Row\", \"Values\"] }\n\n```javascript\nvar Table = require('cli-tableau');\nvar table = new Table({ head: [\"\", \"Top Header 1\", \"Top Header 2\"] });\n\ntable.push(\n    { 'Left Header 1': ['Value Row 1 Col 1', 'Value Row 1 Col 2'] },\n    { 'Left Header 2': ['Value Row 2 Col 1', 'Value Row 2 Col 2'] }\n);\n\nconsole.log(table.toString());\n```\n\n### Custom styles\n\nThe ```chars``` property controls how the table is drawn:\n```javascript\nvar table = new Table({\n  chars: {\n    'top': '═' , 'top-mid': '╤' , 'top-left': '╔' , 'top-right': '╗',\n    'bottom': '═' , 'bottom-mid': '╧' , 'bottom-left': '╚' , 'bottom-right': '╝',\n    'left': '║' , 'left-mid': '╟' , 'mid': '─' , 'mid-mid': '┼',\n    'right': '║' , 'right-mid': '╢' , 'middle': '│'\n  }\n});\n\ntable.push(\n    ['foo', 'bar', 'baz'],\n    ['frob', 'bar', 'quuz']\n);\n\nconsole.log(table.toString());\n// Outputs:\n//\n//╔══════╤═════╤══════╗\n//║ foo  │ bar │ baz  ║\n//╟──────┼─────┼──────╢\n//║ frob │ bar │ quuz ║\n//╚══════╧═════╧══════╝\n```\n\nEmpty decoration lines will be skipped, to avoid vertical separator rows just\nset the 'mid', 'left-mid', 'mid-mid', 'right-mid' to the empty string:\n```javascript\nvar table = new Table({ chars: {'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': ''} });\ntable.push(\n    ['foo', 'bar', 'baz'],\n    ['frobnicate', 'bar', 'quuz']\n);\n\nconsole.log(table.toString());\n// Outputs: (note the lack of the horizontal line between rows)\n//┌────────────┬─────┬──────┐\n//│ foo        │ bar │ baz  │\n//│ frobnicate │ bar │ quuz │\n//└────────────┴─────┴──────┘\n```\n\nBy setting all chars to empty with the exception of 'middle' being set to a\nsingle space and by setting padding to zero, it's possible to get the most\ncompact layout with no decorations:\n```javascript\nvar table = new Table({\n  chars: {\n    'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': '',\n    'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': '',\n    'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': '',\n    'right': '' , 'right-mid': '' , 'middle': ' '\n  },\n  style: { 'padding-left': 0, 'padding-right': 0 }\n});\n\ntable.push(\n    ['foo', 'bar', 'baz'],\n    ['frobnicate', 'bar', 'quuz']\n);\n\nconsole.log(table.toString());\n// Outputs:\n//foo        bar baz\n//frobnicate bar quuz\n```\n\n## Credits\n\n- Guillermo Rauch &lt;guillermo@learnboost.com&gt; ([Guille](http://github.com/guille))\n","_attachments":{},"homepage":"https://github.com/Keymetrics/cli-table#readme","bugs":{"url":"https://github.com/Keymetrics/cli-table/issues"}}