Socket
Book a DemoInstallSign in
Socket

yatf

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yatf

Yet another ASCII table formatter

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

yatf

Yet Another Table Formatter, obviously. The point of this one is to handle column layout and fit into the current window size. It leaves the formatting completely up to you, except for the underlineHeaders option which you can't do anyway until you know how wide the columns become.

If the window isn't wide enough to display all columns, they'll be truncated and markers indicating this will be shown.

Example

var table = require('yatf');

var headers = [ 'NAME', 'PROPERTY', 'VALUE', 'SOURCE' ];

var data = [
[ 'zones'.bold, 'compressratio', '1.06x', '-' ],
[ 'zones/01b2c898-945f-11e1-a523-af1afbe22822'.blue.bold, 'compressratio', '1.93x'.magenta, '-' ],
// ...
[ 'zones/b2535e73-0892-4183-9e02-0255c6dde661/data'.magenta.bold, 'compressratio', '1.34x'.magenta, '-' ],
];

table(headers, data, { underlineHeaders: true });

License

MIT

FAQs

Package last updated on 05 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts