https://github.com/peterroe/tablegger
Print table structure, support color characters
https://github.com/peterroe/tablegger
browser logger nodejs table table-logger
Last synced: 11 months ago
JSON representation
Print table structure, support color characters
- Host: GitHub
- URL: https://github.com/peterroe/tablegger
- Owner: peterroe
- License: mit
- Created: 2023-08-19T08:33:46.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-05-01T12:06:14.000Z (about 1 year ago)
- Last Synced: 2025-06-07T00:10:05.319Z (12 months ago)
- Topics: browser, logger, nodejs, table, table-logger
- Language: TypeScript
- Homepage: https://tablegger.vercel.app
- Size: 646 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## tablegger
For printing tabular structured data, optional configuration and automatic alignment.
## Feature
* 📦 Out-of-the-box ANSI code support.
* ⚙️ Supports flexible configurations such as borders and paddings.
* 🔧 Automatic alignment.
* 🤙🏻 Modify configuration anytime, anywhere.
* 🦾 TypeScript, of course.
## Try it now!
```bash
$ pnpm i tablegger
```
## Usage
```ts
import { Tablegger } from 'tablegger'
const logger = new Tablegger({
theme: 'table',
}).setRowHeaders(['Stage', 'Time', 'Rss', 'HeapTotal', 'HeapUsed'])
logger.addRow(['Init', '0ms', '38 MiB', '6.08 MiB', '5.12 MiB'])
logger.addRow(['Import', '4.7ms', '+9.63 MiB', '+4.77 MiB', '+4.77 MiB'])
logger.addRow(['Called', '7.24ms', '+0 Byte', '+0 Byte', '+792 Bytes'])
console.log('table theme:')
console.log(logger.toString())
// Change Config anywhere, anyTime
logger.setConfig({
theme: 'horizontalLine',
})
console.log('horizontalLine theme:')
console.log(logger.toString())
logger.setConfig({
theme: 'doubleLine',
})
console.log('doubleLine theme:')
console.log(logger.toString())
```

[Read the documentation](https://tablegger.vercel.app) for more information