Gathering detailed insights and metrics for table-layout
Gathering detailed insights and metrics for table-layout
Gathering detailed insights and metrics for table-layout
Gathering detailed insights and metrics for table-layout
cliui
easily create complex multi-column command-line-interfaces
@isaacs/cliui
easily create complex multi-column command-line-interfaces
as-table
A simple function that print objects / arrays as ASCII tables. Handles ANSI styling and weird 💩 Unicode emoji symbols – they won't break the layout.
@riil-frontend/component-table-layout
上面是过滤,中间,下面分页器的布局
Styleable plain-text table generator. Useful for formatting console output.
npm install table-layout
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.4
Supply Chain
99.6
Quality
78.5
Maintenance
100
Vulnerability
100
License
JavaScript (97.18%)
HTML (2.82%)
Total Downloads
309,693,006
Last Day
335,502
Last Week
2,482,047
Last Month
10,106,987
Last Year
96,502,895
MIT License
24 Stars
227 Commits
6 Forks
2 Watchers
3 Branches
5 Contributors
Updated on Apr 14, 2025
Minified
Minified + Gzipped
Latest Version
4.1.1
Package Id
table-layout@4.1.1
Unpacked Size
60.54 kB
Size
13.13 kB
File Count
13
NPM Version
10.8.2
Node Version
22.5.1
Published on
Jul 31, 2024
Cumulative downloads
Total Downloads
Styleable plain-text table generator. Useful for formatting console output. Available as both a command-line tool and isomorphic Javascript library.
Add table-layout to your project:
$ npm install --save table-layout
Trivial example. Read a JSON file from disk and output a table with a maximum width (in characters) of 60.
1import Table from 'table-layout' 2import { promises as fs } from 'fs' 3 4const issues = await fs.readFile('./issues.json', 'utf8') 5const table = new Table(JSON.parse(issues), { maxWidth: 60 }) 6 7console.log(table.toString()) 8
This is the example input file:
1[ 2 { 3 "number": 15134, 4 "title": "Coveralls has no source available ", 5 "login": "ndelangen", 6 "comments": 0 7 }, 8 { 9 "number": 15133, 10 "title": "Fixing --preserve-symlinks. Enhancing node to exploit.", 11 "login": "phestermcs", 12 "comments": 0 13 }, 14 { 15 "number": 15131, 16 "title": "Question - Confused about NPM's local installation philosophy", 17 "login": "the1mills", 18 "comments": 0 19 }, 20 { 21 "number": 15130, 22 "title": "Question - global npm cache directory if user is root?", 23 "login": "ORESoftware", 24 "comments": 0 25 } 26]
This is the output:
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
Sometimes, your input data might contain a deeper structure or you want to transform or compute some values. Some example input data with structural depth and large numbers you'd like to reformat:
1[ 2 { 3 "country": { "name": "USA" }, 4 "GDP": 19485394000000, 5 "population": 325084756 6 }, 7 { 8 "country": { "name": "China" }, 9 "GDP": 12237700479375, 10 "population": 1421021791 11 }, 12 { 13 "country": { "name": "Japan" }, 14 "GDP": 4872415104315, 15 "population": 127502725 16 } 17]
Example usage of the column getter function:
1import Table from 'table-layout' 2import { promises as fs } from 'fs' 3 4const rows = JSON.parse(await fs.readFile('./example/deep-data/gdp.json', 'utf8')) 5const germanCurrency = new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }) 6const germanNumber = new Intl.NumberFormat('de-DE', { notation: 'compact', maximumSignificantDigits: 3, maximumFractionDigits: 0 }) 7 8const table = new Table(rows, { 9 maxWidth: 60, 10 columns: [ 11 { 12 name: 'country', 13 get: (cellValue) => cellValue.name 14 }, 15 { 16 name: 'GDP', 17 get: (cellValue) => germanCurrency.format(cellValue) 18 }, 19 { 20 name: 'population', 21 get: (cellValue) => germanNumber.format(cellValue) 22 }, 23 ] 24}) 25 26console.log(table.toString())
Output.
$ node example/computed-values.js
USA 19.485.394.000.000,00 € 325 Mio.
China 12.237.700.479.375,00 € 1,42 Mrd.
Japan 4.872.415.104.315,00 € 128 Mio.
See this file for a example of colour-scale formatting (increasing intensity of red/green for more positive/negative values).
For the full API documentation, see here.
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
Within a Node.js CommonJS Module:
1const Table = require('table-layout')
Within a Node.js ECMAScript Module:
1import Table from 'table-layout'
Within a modern browser ECMAScript Module:
1import Table from './node_modules/table-layout/dist/index.mjs'
© 2015-24 Lloyd Brookes <75pound@gmail.com>.
Isomorphic test suite by test-runner. Documented by jsdoc-to-markdown.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2025-05-26
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreLast Day
-27.6%
335,502
Compared to previous day
Last Week
-2.4%
2,482,047
Compared to previous week
Last Month
5.8%
10,106,987
Compared to previous month
Last Year
45%
96,502,895
Compared to previous year