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

@types/easy-table

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/easy-table

Stub TypeScript definitions entry for easy-table, which provides its own types definitions

  • 1.2.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
121K
decreased by-17.78%
Maintainers
0
Weekly downloads
 
Created

What is @types/easy-table?

@types/easy-table provides TypeScript type definitions for the easy-table package, which is a simple and flexible way to create ASCII tables in the terminal or console.

What are @types/easy-table's main functionalities?

Basic Table Creation

This feature allows you to create a basic table with rows and columns. Each cell is defined with a column name and a value, and new rows are added using the newRow() method.

const Table = require('easy-table');
const t = new Table();
t.cell('Name', 'John Doe');
t.cell('Age', 28);
t.newRow();
t.cell('Name', 'Jane Doe');
t.cell('Age', 26);
console.log(t.toString());

Custom Column Widths

This feature allows you to customize the width of columns and sort the table based on specific columns. The sort method can be used to sort the table by any column in ascending or descending order.

const Table = require('easy-table');
const t = new Table();
t.cell('Name', 'John Doe');
t.cell('Age', 28);
t.newRow();
t.cell('Name', 'Jane Doe');
t.cell('Age', 26);
t.sort(['Age|des']);
console.log(t.print());

Formatting Cells

This feature allows you to format the content of cells. For example, you can format numbers to a specific number of decimal places using the Table.number() method.

const Table = require('easy-table');
const t = new Table();
t.cell('Name', 'John Doe');
t.cell('Age', 28, Table.number(0));
t.newRow();
t.cell('Name', 'Jane Doe');
t.cell('Age', 26, Table.number(0));
console.log(t.toString());

Other packages similar to @types/easy-table

FAQs

Package last updated on 23 Oct 2024

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