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

console.table

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

console.table

Adds console.table method that prints an array of objects as a table in console

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
408K
decreased by-61.67%
Maintainers
1
Weekly downloads
 
Created

What is console.table?

The console.table npm package allows you to display tabular data in a visually appealing table format directly in the console. This can be particularly useful for debugging and logging purposes, making it easier to read and understand complex data structures.

What are console.table's main functionalities?

Display Array of Objects

This feature allows you to display an array of objects in a table format. Each object represents a row, and the keys of the objects represent the columns.

const cTable = require('console.table');
const data = [
  { name: 'John', age: 30 },
  { name: 'Jane', age: 25 }
];
console.table(data);

Display Array of Arrays

This feature allows you to display an array of arrays in a table format. Each inner array represents a row, and the elements of the inner arrays represent the columns.

const cTable = require('console.table');
const data = [
  ['John', 30],
  ['Jane', 25]
];
console.table(data);

Display Object of Objects

This feature allows you to display an object of objects in a table format. Each key-value pair in the outer object represents a row, and the keys of the inner objects represent the columns.

const cTable = require('console.table');
const data = {
  person1: { name: 'John', age: 30 },
  person2: { name: 'Jane', age: 25 }
};
console.table(data);

Other packages similar to console.table

Keywords

FAQs

Package last updated on 15 Oct 2014

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