{"id":28616608,"url":"https://github.com/console-table-printer/console-table-printer","last_synced_at":"2025-06-12T03:05:04.625Z","repository":{"id":34081470,"uuid":"166671225","full_name":"console-table-printer/console-table-printer","owner":"console-table-printer","description":"🖥️  🍭 Printing Pretty Tables on your console","archived":false,"fork":false,"pushed_at":"2025-06-10T10:12:09.000Z","size":2898,"stargazers_count":190,"open_issues_count":18,"forks_count":22,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T11:42:51.192Z","etag":null,"topics":["console","console-table","console-tool","consolelog","opensource","opensource-library","table-generator","tables"],"latest_commit_sha":null,"homepage":"https://console-table.netlify.app","language":"TypeScript","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/console-table-printer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-20T14:34:17.000Z","updated_at":"2025-06-11T03:07:31.000Z","dependencies_parsed_at":"2023-02-18T10:46:06.470Z","dependency_job_id":"43adf604-3a9d-4760-b05d-a77178e9406f","html_url":"https://github.com/console-table-printer/console-table-printer","commit_stats":{"total_commits":419,"total_committers":13,"mean_commits":32.23076923076923,"dds":0.532219570405728,"last_synced_commit":"6348031a3bfafcd1b7dfc5c888b1e8d4516ad5f8"},"previous_names":["console-table-printer/console-table-printer","ayonious/console-table-printer"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/console-table-printer/console-table-printer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/console-table-printer%2Fconsole-table-printer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/console-table-printer%2Fconsole-table-printer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/console-table-printer%2Fconsole-table-printer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/console-table-printer%2Fconsole-table-printer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/console-table-printer","download_url":"https://codeload.github.com/console-table-printer/console-table-printer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/console-table-printer%2Fconsole-table-printer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259387620,"owners_count":22849748,"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":["console","console-table","console-tool","consolelog","opensource","opensource-library","table-generator","tables"],"created_at":"2025-06-12T03:01:47.247Z","updated_at":"2025-06-12T03:05:04.620Z","avatar_url":"https://github.com/console-table-printer.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003econsole-table-printer\u003c/h1\u003e\n\n\u003e 🖥️🍭Printing Pretty Tables on your console\u003c/h3\u003e\n\n![NPM Downloads](https://img.shields.io/npm/dw/console-table-printer)\n[![install size](https://packagephobia.com/badge?p=console-table-printer)](https://packagephobia.com/result?p=console-table-printer)\n[![npm version](https://badge.fury.io/js/console-table-printer.svg)](https://badge.fury.io/js/console-table-printer)\n[![codecov](https://codecov.io/gh/console-table-printer/console-table-printer/graph/badge.svg?token=SWX9VBuYUs)](https://codecov.io/gh/console-table-printer/console-table-printer)\n\n## Synopsis\n\nPrinting Simple Table with Coloring rows on your console. Its useful when you want to present some tables on console using js.\n\n## Installation\n\n```bash\nnpm install console-table-printer --save\n```\n\n## Basic Example\n\n```javascript\nconst { printTable } = require('console-table-printer');\n\n//Create a table\nconst testCases = [\n  { Rank: 3, text: 'I would like some Yellow', value: 100 },\n  { Rank: 4, text: 'I hope batch update is working', value: 300 },\n];\n\n//print\nprintTable(testCases);\n```\n\n![Screenshot](https://cdn.jsdelivr.net/gh/console-table-printer/console-table-printer@master/static-resources/readme-quick-1.png)\n\n## 🚨🚨Announcement🚨🚨 Official Documentation is moved [Here](https://console-table.netlify.app/docs)\n\nYou can also create a Table instance and print it:\n\n```javascript\nconst { Table } = require('console-table-printer');\n\n//Create a table\nconst p = new Table();\n\n// add rows with color\np.addRow({ Record: 'a', text: 'red wine please', value: 10.212 });\np.addRow({ Record: 'b', text: 'green gemuse please', value: 20.0 });\np.addRows([\n  // adding multiple rows are possible\n  { Record: 'c', text: 'gelb bananen bitte', value: 100 },\n  { Record: 'd', text: 'update is working', value: 300 },\n]);\n\n//print\np.printTable();\n```\n\n![Screenshot](https://cdn.jsdelivr.net/gh/console-table-printer/console-table-printer@master/static-resources/readme-instance-1.png)\n\nYou can also put some color to your table like this:\n\n```javascript\nconst p = new Table();\np.addRow({ description: 'red wine', value: 10.212 }, { color: 'red' });\np.addRow({ description: 'green gemuse', value: 20.0 }, { color: 'green' });\np.addRow({ description: 'gelb bananen', value: 100 }, { color: 'yellow' });\np.printTable();\n```\n\n![Screenshot](https://cdn.jsdelivr.net/gh/console-table-printer/console-table-printer@master/static-resources/readme-color-1.png)\n\nYou can also put properties based on columns (color/alignment/title)\n\n```javascript\nconst p = new Table({\n  columns: [\n    { name: 'id', alignment: 'left', color: 'blue' }, // with alignment and color\n    { name: 'text', alignment: 'right' },\n    { name: 'is_priority_today', title: 'Is This Priority?' }, // with Title as separate Text\n  ],\n  colorMap: {\n    custom_green: '\\x1b[32m', // define customized color\n  },\n});\n\np.addRow({ id: 1, text: 'red wine', value: 10.212 }, { color: 'green' });\np.addRow(\n  { id: 2, text: 'green gemuse', value: 20.0 },\n  { color: 'custom_green' } // your green\n);\np.addRow(\n  { id: 3, text: 'gelb bananen', value: 100, is_priority_today: 'Y' },\n  { color: 'yellow' }\n);\np.addRow({ id: 3, text: 'rosa hemd wie immer', value: 100 }, { color: 'cyan' });\n\np.printTable();\n```\n\n![Screenshot](https://cdn.jsdelivr.net/gh/console-table-printer/console-table-printer@master/static-resources/readme-columns-1.png)\n\n## CLI\n\nThere is also a CLI tool for printing Tables on Terminal directly [table-printer-cli](https://www.npmjs.com/package/table-printer-cli)\n\n## Documentation\n\nOfficial documentation has been moved here: [console-table-documentation](https://console-table.netlify.app)\n\n### Table instance creation\n\n3 ways to Table Instance creation:\n\n1. Simplest way `new Table()`\n\n2. Only with column names: `new Table(['column1', 'column2', 'column3'])`\n\n3. Detailed way of creating table instance\n\n```javascript\nnew Table({\n  title: 'Title of the Table', // A text showsup on top of table (optoinal)\n  columns: [\n    { name: 'column1', alignment: 'left', color: 'red' }, // with alignment and color\n    { name: 'column2', alignment: 'right', maxLen: 30 }, // lines bigger than this will be splitted in multiple lines\n    { name: 'column3', title: 'Column3' }, // Title is what will be shown while printing, by default title = name\n  ],\n  rows: [{ column1: 'row1' }, { column2: 'row2' }, { column3: 'row3' }],\n  sort: (row1, row2) =\u003e row2.column1 - row1.column1, // sorting order of rows (optional), this is normal js sort function for Array.sort\n  filter: (row) =\u003e row.column1 \u003c 3, // filtering rows (optional)\n  enabledColumns: ['column1'], // array of columns that you want to see, all other will be ignored (optional)\n  disabledColumns: ['column2'], // array of columns that you DONT want to see, these will always be hidden\n  colorMap: {\n    custom_green: '\\x1b[32m', // define customized color\n  },\n  charLength: {\n    '👋': 2,\n    '😅': 2,\n  }, // custom len of chars in console\n  defaultColumnOptions: {\n    alignment: 'center',\n    color: 'red',\n    maxLen: 40,\n    minLen: 20,\n  },\n});\n```\n\n### Functions\n\n- `addRow(rowObjet, options)` adding single row. This can be chained\n- `addRows(rowObjects, options)` adding multiple rows. array of row object. This case options will be applied to all the objects in row\n- `addColumn(columnObject)` adding single column\n- `addColumns(columnObjects)` adding multiple columns\n- `printTable()` Prints the table on your console\n\n### possible `color` values for rows\n\nCheck Docs: [color-vals](https://console-table.netlify.app/docs/doc-color)\n\nExample usage: To Create a row of color blue\n\n```js\ntable.addRow(rowObject, { color: 'blue' });\n```\n\nExample usage: To apply blue for all rows\n\n```js\ntable.addRows(rowsArray, { color: 'blue' });\n```\n\n### possible `alignment` values for columns\n\nCheck Docs: [alignment-vals](https://console-table.netlify.app/docs/doc-alignment)\n\n### Typescript Support\n\nYou can get color / alignment as types. Check Docs: [types-docs](https://console-table.netlify.app/docs/doc-typescript)\n\n## License\n\n[MIT](https://github.com/console-table-printer/console-table-printer/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsole-table-printer%2Fconsole-table-printer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconsole-table-printer%2Fconsole-table-printer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsole-table-printer%2Fconsole-table-printer/lists"}