keymetrics / cli-tableau Goto Github PK
View Code? Open in Web Editor NEWPretty unicode tables for the CLI with Node.JS
Home Page: https://travis-ci.org/github/keymetrics/cli-tableau
License: MIT License
Pretty unicode tables for the CLI with Node.JS
Home Page: https://travis-ci.org/github/keymetrics/cli-tableau
License: MIT License
like this demo:
var table = new Table({
head: ['name', 'version']
});
table.push(['卡片', '1.0.0']);
console.log(table.toString());
The border in the vertical direction will be misaligned, like:
┌────┬───────┐
│ name│ version │
├────┼───────┤
│ 卡片 │ 1.0.0 │
└────┴───────┘
Hello 👋
I run a security community that finds and fixes vulnerabilities in OSS. A researcher (@Ilaygoldman) has found a potential issue, which I would be eager to share with you.
Could you add a SECURITY.md
file with an e-mail address for me to send further details to? GitHub recommends a security policy to ensure issues are responsibly disclosed, and it would help direct researchers in the future.
Looking forward to hearing from you 👍
(cc @huntr-helper)
cc @soyuka
Thanks!
Right now mocha
is marked as regular dependency, but it is used only for tests.
Hi @Unitech @rauchg I have opened a PR (418sec#1) which will fix the a possible Prototype Pollution bug in cli-tableau. Please take a review.
If you are fine with that fix, please comment @huntr-helper - LGTM at 418sec#1, or if you need any modifications, please also comment on that PR. Thanks.
Ref: 418sec#1
This issue is related to issue with PM2 (Unitech/pm2#4369)
After the table is printed to console, it oddly leaves font bold & bright white:
Wonder if cli-tableau dev team has any ideas why this could be happening?
Here is the contents of cli-tableau object before printed to console with .toString() :
(suggest copy/paste into some JSONlint tool to read better)
Array { '0': { '\u001b[1m\u001b[36m0\u001b[39m\u001b[22m': [ 'start_mongo', 'default', 'N/A', '\u001b[7m\u001b[1mfork\u001b[22m\u001b[27m', 16765, '54m', 0, '\u001b[32m\u001b[1monline\u001b[22m\u001b[39m', '0%', '1.2mb ', '\u001b[1mjuliauser\u001b[22m', '\u001b[90mdisabled\u001b[39m' ] }, options: { chars: { top: '─', 'top-mid': '┬', 'top-left': '┌', 'top-right': '┐', bottom: '─', 'bottom-mid': '┴', 'bottom-left': '└', 'bottom-right': '┘', left: '│', 'left-mid': '├', mid: '─', 'mid-mid': '┼', right: '│', 'right-mid': '┤', middle: '│' }, truncate: '…', colWidths: [ 5, 16, 13, 9, 9, 10, 8, 6, 11, 10, 10, 10, 10 ], colAligns: [ 'left' ], style: { 'padding-left': 1, 'padding-right': 1, head: [Array], border: [Array], compact: true }, head: [ 'id', 'name', 'namespace', 'version', 'mode', 'pid', 'uptime', '↺', 'status', 'cpu', 'mem', 'user', 'watching' ] }, length: 1 }
Also here is contents of options.style.head & options.style.border:
options.style.head:
[ 'cyan', 'bold' ]
options.style.border:
[ 'grey' ]
Please let me know if anything comes to mind! Thank you!
using node 14.x/15.x, the right
align feature does not appear to work.
It may be because the padEnd function does not have 3 parameters. So for now I just copied and patched in my repo (breaking left alignment), but if you interested in a PR, I'd be happy to provide one, although I'm not sure how I would support middle (whether the extra char would be on the left or right?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.