borderless-table

2.0.0 • Public • Published

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    

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    1,211
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    1,211
  • 1.0.1
    73
  • 1.0.0
    0

Package Sidebar

Install

npm i borderless-table

Weekly Downloads

1,284

Version

2.0.0

License

ISC

Last publish

Collaborators

  • marcbachmann