https://github.com/marcbachmann/borderless-table
https://github.com/marcbachmann/borderless-table
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcbachmann/borderless-table
- Owner: marcbachmann
- Created: 2016-06-14T21:02:02.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:17:58.000Z (over 2 years ago)
- Last Synced: 2025-03-11T14:47:57.807Z (over 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# borderless-table
Takes a collection and outputs a borderless table in the terminal or browser console.
# API
```javascript
var table = require('borderless-table')
table(collection, [columns], [columnLabels], [stdout])
```
### Output keys that are contained in the first object
```javascript
table([
{name: 'Tokyo', country: 'Japan'},
{name: 'New York', country: 'USA'},
{name: 'São Paulo', country: 'Brazil'},
{name: 'Zürich', country: 'Switzerland'},
])
// name country
// ----------------------
// Tokyo Japan
// New York USA
// São Paulo Brazil
// Zürich Switzerland
```
### Output specific properties
```javascript
table([
{name: 'Tokyo', country: 'Japan'},
], ['name'])
// name
// ---------
// Tokyo
```
### Use a custom column label
```
table([
{name: 'Tokyo', country: 'Japan'},
], ['name'], ['City name'])
// City name
// ---------
// Tokyo
```