Skip to content

marcbachmann/borderless-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

borderless-table

Takes a collection and outputs a borderless table in the terminal or browser console.

API

var table = require('borderless-table')
table(collection, [columns], [columnLabels], [stdout])

Output keys that are contained in the first object

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

table([
  {name: 'Tokyo', country: 'Japan'},
], ['name'])

// name     
// ---------
// Tokyo    

Use a custom column label

table([
  {name: 'Tokyo', country: 'Japan'},
], ['name'], ['City name'])

// City name
// ---------
// Tokyo    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published