Files
iptv/scripts/core/cliTable.ts

23 lines
413 B
TypeScript
Raw Normal View History

2025-03-15 07:31:10 +03:00
import { Table } from 'console-table-printer'
2025-03-29 11:39:46 +03:00
import { ComplexOptions } from 'console-table-printer/dist/src/models/external-table'
2025-03-15 07:31:10 +03:00
export class CliTable {
table: Table
2025-03-29 11:39:46 +03:00
constructor(options?: ComplexOptions | string[]) {
2025-03-15 07:31:10 +03:00
this.table = new Table(options)
}
append(row) {
this.table.addRow(row)
}
render() {
this.table.printTable()
}
toString() {
return this.table.render()
}
}