# tablr

> A module that generates plain-text tables from JSON data

Latest version **1.0.2** (published 2016-08-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install tablr
pnpm add tablr
yarn add tablr
bun add tablr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-08-07 |
| First published | 2016-08-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jesse Kramer |
| Maintainers | frontendcoffee |
| Keywords | table, debug, console, plaintext |

## Links

- npm: https://www.npmjs.com/package/tablr
- Repository: https://github.com/FrontEndCoffee/tablr
- Homepage: https://github.com/FrontEndCoffee/tablr#readme
- Issues: https://github.com/FrontEndCoffee/tablr/issues
- npm.io page: https://npm.io/package/tablr

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-08-07
- 1.0.1 — 2016-08-07
- 1.0.0 — 2016-08-07

## README

# tablr
A module that generates plain-text tables from JSON data

A piece of JSON data you might want to process is:
``` javascript
[
  ["Lannister", "The Crownlands", "Hear me roar"],
  ["Stark", "The North", "Winter is coming"],
  ["Frey", "The Riverlands", "unknown"],
  ["Tyrell", "The Reach", "Growing strong"],
  ["Martell", "Dorne", "Unbowed, unbent, unbroken"],
  ["Greyjoy", "The Iron Islands", "We do not sow"],
  ["Arryn", "The vale of Arryn", "High as honor"],
  ["Targaryen", "n/a", "Fire and blood"]  
]
```
This data will be used in all the examples.

## tablr.simple

For the sample data you'll use the module like this:
``` javascript
console.log(
  tablr.simple( data )
)
```

And the output will look like this:
```
-------------------------------------------------------------
| Lannister | The Crownlands    | Hear me roar              |
-------------------------------------------------------------
| Stark     | The North         | Winter is coming          |
-------------------------------------------------------------
| Frey      | The Riverlands    | unknown                   |
-------------------------------------------------------------
| Tyrell    | The Reach         | Growing strong            |
-------------------------------------------------------------
| Martell   | Dorne             | Unbowed, unbent, unbroken |
-------------------------------------------------------------
| Greyjoy   | The Iron Islands  | We do not sow             |
-------------------------------------------------------------
| Arryn     | The vale of Arryn | High as honor             |
-------------------------------------------------------------
| Targaryen | n/a               | Fire and blood            |
-------------------------------------------------------------
```

## tablr.headed

Of course you might want to add a heading to the table.
``` javascript
console.log(
  tablr.headed(data, ['HOUSE', 'REGION', 'WORDS'])
)
```

And the output will look like this:
```
-------------------------------------------------------------
| HOUSE     | REGION            | WORDS                     |
-------------------------------------------------------------
| Lannister | The Crownlands    | Hear me roar              |
-------------------------------------------------------------
| Stark     | The North         | Winter is coming          |
-------------------------------------------------------------
| Frey      | The Riverlands    | unknown                   |
-------------------------------------------------------------
| Tyrell    | The Reach         | Growing strong            |
-------------------------------------------------------------
| Martell   | Dorne             | Unbowed, unbent, unbroken |
-------------------------------------------------------------
| Greyjoy   | The Iron Islands  | We do not sow             |
-------------------------------------------------------------
| Arryn     | The vale of Arryn | High as honor             |
-------------------------------------------------------------
| Targaryen | n/a               | Fire and blood            |
-------------------------------------------------------------
```

---
_Source: https://npm.io/package/tablr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
