Skip to content

Commit 4440bb9

Browse files
authored
convert all to TS (#130)
1 parent 228e194 commit 4440bb9

23 files changed

+63
-52
lines changed

docs/api/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ enum ALIGNMENT {
547547
548548
**Usage:**
549549
```typescript
550-
import { ALIGNMENT } from "console-table-printer";
550+
import { ALIGNMENT } from 'console-table-printer';
551551

552552
const table = new Table({
553553
columns: [
@@ -575,7 +575,7 @@ enum COLOR {
575575
576576
**Usage:**
577577
```typescript
578-
import { COLOR } from "console-table-printer";
578+
import { COLOR } from 'console-table-printer';
579579

580580
const table = new Table({
581581
columns: [

docs/api/core-functions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Prints a table directly from an array of data objects without creating a Table i
2222

2323
**Example:**
2424
```javascript
25-
const { printTable } = require("console-table-printer");
25+
import { printTable } from 'console-table-printer';
2626

2727
const data = [
2828
{ id: 1, name: "John", age: 25 },
@@ -34,7 +34,7 @@ printTable(data);
3434

3535
**With Options:**
3636
```javascript
37-
const { printTable } = require("console-table-printer");
37+
import { printTable } from 'console-table-printer';
3838

3939
const data = [
4040
{ id: 1, name: "John", age: 25, status: "active" },
@@ -134,7 +134,7 @@ interface TableOptions {
134134
### Complete Example
135135

136136
```javascript
137-
const { Table } = require("console-table-printer");
137+
import { Table } from 'console-table-printer';
138138

139139
// Create table with comprehensive configuration
140140
const table = new Table({

docs/doc-add-columns.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ There are several ways to add columns to your table. You can add them one by one
1515
You can add columns individually using the `addColumn` method. This gives you fine-grained control over each column's properties.
1616

1717
```javascript
18-
const { Table } = require("console-table-printer");
18+
import { Table } from 'console-table-printer';
1919

2020
// Initialize table with one column
2121
const p = new Table({
@@ -39,7 +39,7 @@ p.printTable();
3939
For efficiency, you can add multiple columns simultaneously using the `addColumns` method.
4040

4141
```javascript
42-
const { Table } = require("console-table-printer");
42+
import { Table } from 'console-table-printer';
4343

4444
const p = new Table();
4545

@@ -65,7 +65,7 @@ p.printTable();
6565
You can chain `addColumn` calls for a more fluent API experience.
6666

6767
```javascript
68-
const { Table } = require("console-table-printer");
68+
import { Table } from 'console-table-printer';
6969

7070
const p = new Table();
7171

@@ -86,7 +86,7 @@ p.printTable();
8686
You can combine different column addition methods to build your table structure in the most convenient way.
8787

8888
```javascript
89-
const { Table } = require("console-table-printer");
89+
import { Table } from 'console-table-printer';
9090

9191
const p = new Table();
9292

docs/doc-adding-rows.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
99
### One row at a time
1010

1111
```js
12-
const { Table } = require("console-table-printer");
12+
import { Table } from 'console-table-printer';
1313

1414
const p = new Table();
1515

@@ -31,7 +31,7 @@ p.printTable();
3131
## Batch Row Adding
3232

3333
```javascript
34-
const { Table } = require("console-table-printer");
34+
import { Table } from 'console-table-printer';
3535

3636
const p = new Table();
3737

@@ -50,7 +50,7 @@ p.printTable();
5050
Adding row function can be chained
5151

5252
```javascript
53-
const { Table } = require("console-table-printer");
53+
import { Table } from 'console-table-printer';
5454

5555
const p = new Table();
5656

docs/doc-alignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
99
You can put properties for alignment
1010

1111
```javascript
12-
const { Table } = require("console-table-printer");
12+
import { Table } from 'console-table-printer';
1313

1414
const p = new Table({
1515
columns: [

docs/doc-border-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can configure the border of the table by passing style in Table constructor
1111
<img alt="Screenshot" src={useBaseUrl('img/examples/doc-border-design/fat.png')}/>
1212

1313
```js
14-
const { Table } = require("console-table-printer");
14+
import { Table } from 'console-table-printer';
1515

1616
const p = new Table({
1717
style: {

docs/doc-color.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
1111
You can put color as either entire Row or entire column
1212

1313
```js
14-
const { Table } = require("console-table-printer");
14+
import { Table } from 'console-table-printer';
1515

1616
const p = new Table({
1717
columns: [
@@ -41,7 +41,7 @@ p.printTable();
4141
## Batch Row coloring
4242

4343
```javascript
44-
const { printTable, Table } = require("console-table-printer");
44+
import { printTable, Table } from 'console-table-printer';
4545

4646
const p = new Table();
4747

@@ -78,7 +78,7 @@ p.printTable();
7878
You can also choose to have your own colors
7979

8080
```javascript
81-
const { printTable, Table } = require("console-table-printer");
81+
import { printTable, Table } from 'console-table-printer';
8282

8383
const p = new Table({
8484
columns: [

docs/doc-computed-function.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Sometimes you need a new column added automatically whose val is dependent on ot
1111
## Basic Example
1212

1313
```javascript
14-
const { Table } = require("console-table-printer");
14+
import { Table } from 'console-table-printer';
1515
const chalk = require("chalk");
1616

1717
const p = new Table({
@@ -74,7 +74,7 @@ The computed column function can take three parameters:
7474
Here's a simple example showing how to use each parameter:
7575

7676
```javascript
77-
const { Table } = require("console-table-printer");
77+
import { Table } from 'console-table-printer';
7878

7979
const p = new Table({
8080
columns: [
@@ -129,7 +129,7 @@ The output will show each student's score, their pass/fail status, student numbe
129129
### Using Row Index for Ranking
130130

131131
```javascript
132-
const { Table } = require("console-table-printer");
132+
import { Table } from 'console-table-printer';
133133

134134
const table = new Table({
135135
columns: [
@@ -165,7 +165,7 @@ table.printTable();
165165
### Complex Computations with Multiple Subjects
166166

167167
```javascript
168-
const { Table } = require("console-table-printer");
168+
import { Table } from 'console-table-printer';
169169

170170
const table = new Table({
171171
columns: [

docs/doc-emojis-special-chars.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
1111
Special chars might have different length of chars in your console. For that if you want to declare yourself the length of the character then you should use charLength option.
1212

1313
```javascript
14-
import { Table } from "console-table-printer";
14+
import { Table } from 'console-table-printer';
1515
const bundle = new Table({
1616
title: "My Table",
1717
charLength: { "👍": 2, "": 2 },

docs/doc-enable-disable-col.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
1111
Optional param. Pass the names of columns as list. Use it when your json data contains so many garbage that you want only few columns to be visible.
1212

1313
```javascript
14-
const { Table } = require("console-table-printer");
14+
import { Table } from 'console-table-printer';
1515

1616
const p = new Table({
1717
// highlight-next-line
@@ -47,7 +47,7 @@ p.printTable();
4747
This one was good incase you a short listed disabled columns.
4848

4949
```javascript
50-
const { Table } = require("console-table-printer");
50+
import { Table } from 'console-table-printer';
5151

5252
const p = new Table({
5353
// highlight-next-line

0 commit comments

Comments
 (0)