New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

string-table

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

string-table

Formats an array of data objects as a textual table

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
2.8K
-33.06%
Maintainers
1
Weekly downloads
 
Created
Source

stringTable.js

A groundbreaking, innovating JavaScript library to do something that's literally never been attempted before: formatting an array of data objects as a textual table.

var objects = [
  { name: 'Dan', gender: 'M', age: 29 },
  { name: 'Adam', gender: 'M', age: 31 },
  { name: 'Lauren', gender: 'F', age: 33 }
];

var table = stringTable.create(objects);

console.log(table);

/*
 * Output:
 *
 * | name   | gender | age |
 * -------------------------
 * | Dan    | M      |  29 |
 * | Adam   | M      |  31 |
 * | Lauren | F      |  33 |
 */

You can also specify options to customize how the table is formatted:

var table = stringTable.create(objects, options);

The available options are summarized below.

Options

  • headers (e.g., ['name', 'age']): an array of strings indicating which column headers to include
  • formatters: an object mapping column names to formatter functions
  • outerBorder (default: '|'): the character(s) used to enclose the table
  • innerBorder (default: '|'): the character(s) used to delimit cells within the table

FAQs

Package last updated on 20 Sep 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