Skip to content

Instantly share code, notes, and snippets.

@tkambler
Last active April 1, 2019 18:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tkambler/5222d276f783def5ece8 to your computer and use it in GitHub Desktop.
Save tkambler/5222d276f783def5ece8 to your computer and use it in GitHub Desktop.
Displaying Tabular Data in Today Scripts for Yosemite Notification Center
#!/usr/local/bin/node
var Table = require('cli-table');
var table = new Table({
chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': ''
, 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': ''
, 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': ''
, 'right': '' , 'right-mid': '' , 'middle': ' ' },
style: { 'padding-left': 0, 'padding-right': 0 }
});
table.push(
{ 'Some key': 'Some value' }
, { 'Another key': 'Another value' }
);
console.log(table.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment