Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

table-header

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

table-header

Add header to a text table

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.3K
increased by28.35%
Maintainers
1
Weekly downloads
 
Created
Source

npm

table-header

Build Status Dependency Status

Add header to a text table, with border.

Text table is array of rows of equal length:

var table = [
  ['red', '#ff0000'],
  ['green', '#00ff00'],
  ['blue', '#0000ff']
];

Example

var tableHeader = require('table-header');

tableHeader(table, ['color', 'code'])
//=> [
//     ['color', 'code'],
//     ['-----', '-------'],
//     ['red', '#ff0000'],
//     ['green', '#00ff00'],
//     ['blue', '#0000ff']
//   ]

API

tableHeader(table, header, [opts])

Returns a new table with header and the same data.

Options:

  • borderfalse for no border, true (default) for --delimited border, single-character string for custom-delimited border.

  • stringLength — string length function, e.g. to ignore escape codes.

tableHeader.add(table, header, [opts])

Add header to existing table, modifying it.

  • text-table module turns these tables to strings.
  • string-length — string length function that ignores escape codes.

Install

npm install table-header

License

MIT

Keywords

FAQs

Package last updated on 05 Jun 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc