Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
table-to-string
Advanced tools
Generates a string representation of a table.
# with npm
npm install table-to-string
# with yarn
yarn add table-to-string
const tableToString = require('table-to-string');
const isThatA = [
['Jotaro Kujo', 'Star Platinum'],
['Josuke Higashikata', 'Crazy Diamond'],
['Giorno Giovanna', 'Gold Experience Requiem'],
['Jolyne Cujoh', 'Stone Free'],
['Johnny Joestar', 'Tusk'],
];
tableToString(isThatA);
//=> Jotaro Kujo Star Platinum
//=> Josuke Higashikata Crazy Diamond
//=> Giorno Giovanna Gold Experience Requiem
//=> Jolyne Cujoh Stone Free
//=> Johnny Joestar Tusk
const jojoReference = [
['Dio', 'The World'],
['Yoshikage Kira', 'Killer Queen'],
['Diavolo', 'King Crimson'],
['Enrico Pucci', 'Made in Heaven'],
['Funny Valentine', 'Dirty Deeds Done Dirt Cheap'],
];
tableToString(jojoReference, {
align: ['r', 'c'],
str: (item) => `"${item}"`,
sep: ' | ',
});
//=> "Dio" | "The World"
//=> "Yoshikage Kira" | "Killer Queen"
//=> "Diavolo" | "King Crimson"
//=> "Enrico Pucci" | "Made in Heaven"
//=> "Funny Valentine" | "Dirty Deeds Done Dirt Cheap"
Name | Type | Default value | Description |
---|---|---|---|
align | `('l' | 'c' | 'r' |
len | (item: string, column: number) => number | (item) => item.length | The function used to get the item length. |
str | (item: any, column: number) => string | String(item != null ? item : '') | The function used to transform the item into a string. |
sep | string | ' ' (two whitespaces) | The separator between each item. |
lf | string | '\n' | The line feed used for new lines. |
This package is under a MIT license.
FAQs
Generates a string representation of a table.
The npm package table-to-string receives a total of 0 weekly downloads. As such, table-to-string popularity was classified as not popular.
We found that table-to-string 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.