
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
table-layout
Advanced tools
Generates plain-text tables from JSON recordset input (array of objects). Useful for presenting text in column layout or data in table layout in text-based user interfaces. Also available as a command-line tool.
> const Table = require('table-layout')
> const issues = require('./example/issues')
> const table = new Table(issues, { maxWidth: 60 })
> console.log(table.toString())
15134 Coveralls has no source available ndelangen 0
15133 Fixing --preserve-symlinks. phestermcs 0
Enhancing node to exploit.
15131 Question - Confused about NPM's the1mills 0
local installation philosophy
15130 Question - global npm cache ORESoftware 0
directory if user is root?
15127 how to installa gulp fontfacegen aramgreat 0
on Windows 10
15097 Cannot install package from mastertinner 3
tarball out of package.json entry
generated by npm
15067 npm "SELF_SIGNED_CERT_IN_CHAIN" LegendsLyfe 3
error when installing discord.js
with .log
Array.<string>stringRecordset data in (array of objects), text table out.
Params
Array.<object> - input dataobject - optional settings
number - maximum width of layoutboolean - disable wrapping on all columnsboolean - disable line-trimmingboolean - enable word-breaking on all columnscolumnOption - array of column-specific optionsboolean - if set, empty columns or columns containing only whitespace are not rendered.object - Padding values to set on each column. Per-column overrides can be set in the options.columns array.
string - Defaults to a single space.string - Defaults to a single space.Example
> Table = require('table-layout')
> jsonData = [{
col1: 'Some text you wish to read in table layout',
col2: 'And some more text in column two. '
}]
> table = new Table(jsonData, { maxWidth: 30 })
> console.log(table.toString())
Some text you And some more
wish to read text in
in table column two.
layout
Array.<string>Identical to .toString() with the exception that the result will be an array of lines, rather than a single, multi-line string.
Kind: instance method of Table
stringReturns the input data as a text table.
Kind: instance method of Table
Kind: inner typedef of Table
Properties
| Name | Type | Description |
|---|---|---|
| name | string | column name, must match a property name in the input |
| width | number | A specific column width. Supply either this or a min and/or max width. |
| minWidth | number | column min width |
| maxWidth | number | column max width |
| nowrap | boolean | disable wrapping for this column |
| break | boolean | enable word-breaking for this columns |
| padding | object | padding options |
| padding.left | string | a string to pad the left of each cell (default: ' ') |
| padding.right | string | a string to pad the right of each cell (default: ' ') |
© 2015-16 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.
cli-table is a similar package that provides functionalities for rendering unicode-aided tables on the command line. Compared to table-layout, cli-table focuses more on the visual styling of the table borders and padding but does not offer as much control over text wrapping and column width.
ascii-table is another package for creating ASCII tables. It allows for quick and easy table generation with minimal configuration. While it's simpler and less feature-rich than table-layout, it's suitable for applications that require basic table functionalities without the need for advanced formatting options.
FAQs
Stylable text tables, handling ansi colour. Useful for console output.
The npm package table-layout receives a total of 2,750,085 weekly downloads. As such, table-layout popularity was classified as popular.
We found that table-layout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.