console-table-printer 2.16.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +33 -33
  2. package/package.json +19 -8
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <h1 align="center">console-table-printer</h1>
2
2
 
3
- > 🖥️🍭Printing Pretty Tables on your console</h3>
3
+ > 🖥️🍭 Printing pretty tables in your console
4
4
 
5
5
  ![NPM Downloads](https://img.shields.io/npm/dw/console-table-printer)
6
6
  [![install size](https://packagephobia.com/badge?p=console-table-printer)](https://packagephobia.com/result?p=console-table-printer)
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Synopsis
11
11
 
12
- Printing Simple Table with Coloring rows on your console. Its useful when you want to present some tables on console using js.
12
+ Print simple tables with colored rows in your console. It's useful when you want to present tables in console output using JS.
13
13
 
14
14
  ## Installation
15
15
 
@@ -35,7 +35,7 @@ printTable(tasks);
35
35
 
36
36
  ![Screenshot](https://cdn.jsdelivr.net/gh/console-table-printer/console-table-printer@master/static-resources/Example-1-basic.png)
37
37
 
38
- ## 🚨🚨Announcement🚨🚨 Official Documentation is moved [Here](https://console-table.netlify.app/docs)
38
+ ## 🚨🚨Announcement🚨🚨 Official documentation has moved [here](https://console-table.netlify.app/docs)
39
39
 
40
40
  You can also create a Table instance and print it:
41
41
 
@@ -59,7 +59,7 @@ leaderboard.printTable();
59
59
 
60
60
  ![Screenshot](https://cdn.jsdelivr.net/gh/console-table-printer/console-table-printer@master/static-resources/Example-2-instance.png)
61
61
 
62
- You can also put some color to your table like this:
62
+ You can also add color to your table like this:
63
63
 
64
64
  ```typescript
65
65
  import { Table } from 'console-table-printer';
@@ -74,7 +74,7 @@ p.printTable();
74
74
 
75
75
  ![Screenshot](https://cdn.jsdelivr.net/gh/console-table-printer/console-table-printer@master/static-resources/Example-3-color.png)
76
76
 
77
- You can also put properties based on columns (color/alignment/title)
77
+ You can also configure column properties (color/alignment/title).
78
78
 
79
79
  ```typescript
80
80
  import { Table } from 'console-table-printer';
@@ -103,31 +103,31 @@ p.printTable();
103
103
 
104
104
  ## CLI
105
105
 
106
- There is also a CLI tool for printing Tables on Terminal directly [table-printer-cli](https://www.npmjs.com/package/table-printer-cli)
106
+ There is also a CLI tool for printing tables directly in the terminal: [table-printer-cli](https://www.npmjs.com/package/table-printer-cli)
107
107
 
108
108
  ## Documentation
109
109
 
110
- Official documentation has been moved here: [console-table-documentation](https://console-table.netlify.app)
110
+ Official documentation has moved here: [console-table-documentation](https://console-table.netlify.app)
111
111
 
112
112
  ### Table instance creation
113
113
 
114
- 3 ways to Table Instance creation:
114
+ Three ways to create a Table instance:
115
115
 
116
- 1. Simplest way `new Table()`
116
+ 1. Simplest way: `new Table()`
117
117
 
118
- 2. Only with column names: `new Table(['column1', 'column2', 'column3'])`
118
+ 2. With column names only: `new Table(['column1', 'column2', 'column3'])`
119
119
 
120
- 3. Detailed way of creating table instance
120
+ 3. Detailed table instance creation:
121
121
 
122
122
  ```typescript
123
123
  import { Table } from 'console-table-printer';
124
124
 
125
125
  new Table({
126
- title: '📊 Sales Report Q4 2024', // A text showsup on top of table (optional)
126
+ title: '📊 Sales Report Q4 2024', // Text shown above the table (optional)
127
127
  columns: [
128
128
  { name: 'region', alignment: 'left', color: 'blue' }, // with alignment and color
129
- { name: 'sales', alignment: 'right', maxLen: 30 }, // lines bigger than this will be splitted in multiple lines
130
- { name: 'growth', title: 'Growth %' }, // Title is what will be shown while printing, by default title = name
129
+ { name: 'sales', alignment: 'right', maxLen: 30 }, // lines bigger than this will be split into multiple lines
130
+ { name: 'growth', title: 'Growth %' }, // Title is shown while printing; by default, title = name
131
131
  { name: 'price', transform: (value) => `$${Number(value).toFixed(2)}` }, // Transform function to format cell values before display
132
132
  ],
133
133
  rows: [
@@ -135,17 +135,17 @@ new Table({
135
135
  { region: 'Europe', sales: '$1.8M', growth: '+8%' },
136
136
  { region: 'Asia Pacific', sales: '$3.2M', growth: '+22%' },
137
137
  ],
138
- sort: (row1, row2) => row2.sales - row1.sales, // sorting order of rows (optional), this is normal js sort function for Array.sort
138
+ sort: (row1, row2) => row2.sales - row1.sales, // sorting order of rows (optional), using the same comparator shape as Array.sort
139
139
  filter: (row) => row.growth > '+10%', // filtering rows (optional)
140
- enabledColumns: ['region', 'sales'], // array of columns that you want to see, all other will be ignored (optional)
141
- disabledColumns: ['growth'], // array of columns that you DONT want to see, these will always be hidden
140
+ enabledColumns: ['region', 'sales'], // array of columns that you want to see; all others will be ignored (optional)
141
+ disabledColumns: ['growth'], // array of columns that you don't want to see, these will always be hidden
142
142
  colorMap: {
143
- high_growth: '\x1b[32m', // define customized color
143
+ high_growth: '\x1b[32m', // define a custom color
144
144
  },
145
145
  charLength: {
146
146
  '👋': 2,
147
147
  '😅': 2,
148
- }, // custom len of chars in console
148
+ }, // custom character widths in the console
149
149
  defaultColumnOptions: {
150
150
  alignment: 'center',
151
151
  color: 'red',
@@ -157,36 +157,36 @@ new Table({
157
157
 
158
158
  ### Functions
159
159
 
160
- - `addRow(rowObjet, options)` adding single row. This can be chained
161
- - `addRows(rowObjects, options)` adding multiple rows. array of row object. This case options will be applied to all the objects in row
162
- - `clearRows()` removes all rows while keeping the table columns and options. This can be chained
163
- - `addColumn(columnObject)` adding single column
164
- - `addColumns(columnObjects)` adding multiple columns
165
- - `printTable()` Prints the table on your console
160
+ - `addRow(rowObject, options)` Adds a single row. This can be chained.
161
+ - `addRows(rowObjects, options)` Adds multiple rows. This accepts an array of row objects. In this case, options will be applied to all rows.
162
+ - `clearRows()` Removes all rows while keeping the table columns and options. This can be chained.
163
+ - `addColumn(columnObject)` Adds a single column.
164
+ - `addColumns(columnObjects)` Adds multiple columns.
165
+ - `printTable()` Prints the table in your console.
166
166
 
167
- ### possible `color` values for rows
167
+ ### Possible `color` values for rows
168
168
 
169
- Check Docs: [color-vals](https://console-table.netlify.app/docs/doc-color)
169
+ Check docs: [color-vals](https://console-table.netlify.app/docs/doc-color)
170
170
 
171
- Example usage: To Create a row of color blue
171
+ Example usage: To create a blue row
172
172
 
173
173
  ```typescript
174
174
  table.addRow(rowObject, { color: 'blue' });
175
175
  ```
176
176
 
177
- Example usage: To apply blue for all rows
177
+ Example usage: To apply blue to all rows
178
178
 
179
179
  ```typescript
180
180
  table.addRows(rowsArray, { color: 'blue' });
181
181
  ```
182
182
 
183
- ### possible `alignment` values for columns
183
+ ### Possible `alignment` values for columns
184
184
 
185
- Check Docs: [alignment-vals](https://console-table.netlify.app/docs/doc-alignment)
185
+ Check docs: [alignment-vals](https://console-table.netlify.app/docs/doc-alignment)
186
186
 
187
- ### Typescript Support
187
+ ### TypeScript Support
188
188
 
189
- You can get color / alignment as types. Check Docs: [types-docs](https://console-table.netlify.app/docs/doc-typescript)
189
+ You can get color and alignment as types. Check docs: [types-docs](https://console-table.netlify.app/docs/doc-typescript)
190
190
 
191
191
  ## License
192
192
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "console-table-printer",
3
- "version": "2.16.0",
3
+ "version": "2.16.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/console-table-printer/console-table-printer.git"
@@ -19,9 +19,20 @@
19
19
  },
20
20
  "keywords": [
21
21
  "console-table",
22
- "console-log",
23
- "print-table",
24
- "node-table-printing"
22
+ "terminal-table",
23
+ "table-printer",
24
+ "pretty-table",
25
+ "cli-table",
26
+ "unicode-table",
27
+ "console-output",
28
+ "ascii-table",
29
+ "colored-table",
30
+ "table-formatter",
31
+ "object-table",
32
+ "pretty-print",
33
+ "json-table",
34
+ "json-to-table",
35
+ "array-to-table"
25
36
  ],
26
37
  "files": [
27
38
  "dist"
@@ -33,10 +44,10 @@
33
44
  "@semantic-release/changelog": "^6.0.3",
34
45
  "@semantic-release/git": "^10.0.1",
35
46
  "@types/jest": "^30.0.0",
36
- "@types/node": "^25.9.1",
37
- "eslint": "^10.4.0",
47
+ "@types/node": "^25.9.2",
48
+ "eslint": "^10.4.1",
38
49
  "eslint-config-prettier": "^10.1.8",
39
- "eslint-plugin-prettier": "^5.5.5",
50
+ "eslint-plugin-prettier": "^5.5.6",
40
51
  "husky": "^9.1.7",
41
52
  "jest": "^30.4.2",
42
53
  "prettier": "^3.8.3",
@@ -44,7 +55,7 @@
44
55
  "semantic-release": "^25.0.3",
45
56
  "ts-jest": "^29.4.11",
46
57
  "typescript": "^6.0.3",
47
- "typescript-eslint": "^8.60.0"
58
+ "typescript-eslint": "^8.60.1"
48
59
  },
49
60
  "homepage": "https://console-table.netlify.app",
50
61
  "dependencies": {