Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
console-grid
Advanced tools
npm install console-grid
┌────────────────────────────────────────┬─────────┬──────┬──────────────┬──────────────┐
│ │ │ │ Number │ Multiple │
│ │ │ │ Format red │ Line Header │
│ Name bg green │ Value │ Null │ LongWordL... │ Name │
├────────────────────────────────────────┼─────────┼──────┼──────────────┼──────────────┤
│ ├ Row Name │ 3 │ - │ 3.00 │ 3 │
│ ├ Row Long Name Red Long Name Long ... │ 4 │ - │ 4.00 │ 4 │
│ ├ Row 8 bright bg blue │ 8 │ - │ 8.00 │ 8 │
│ │ ├ Sub Row 3 │ s3 s... │ - │ 13.00 │ s3 s3 s3 │
│ │ ├ Sub Row 2 │ s2s2s2 │ - │ 12.00 │ s2s2s2 s │
│ │ └ Sub Row 1 │ s1 │ - │ 11.00 │ s1 │
│ │ ├ Sub Row 22 │ s22 │ - │ 22.00 │ s22 │
│ │ └ Sub Row 21 │ s21 │ - │ 21.00 │ s21 │
│ ├ Row 7 bright blue │ 7 │ - │ 7.00 │ 7 │
│ ├ Row 6 bg green │ 6 │ - │ 6.00 │ 6 │
│ ├ Row 5 red │ 5 │ - │ - │ 5 │
│ ├ Row 2 │ 2 │ - │ 2.00 │ 2 │
│ └ Row 1 │ 1 │ - │ 1.00 │ 1 │
└────────────────────────────────────────┴─────────┴──────┴──────────────┴──────────────┘
hide headers, no tree, sort by name:
┌────────────────────────────────────────┬─────┬─────┬──────┬─────┐
│ Row Name │ 3 │ - │ 3.00 │ 3 │
│ Row Long Name Red Long Name Long G ... │ 4 │ - │ 4.00 │ 4 │
│ Row 8 bright bg blue │ 8 │ - │ 8.00 │ 8 │
│ Row 7 bright blue │ 7 │ - │ 7.00 │ 7 │
│ Row 6 bg green │ 6 │ - │ 6.00 │ 6 │
│ Row 5 red │ 5 │ - │ - │ 5 │
│ Row 2 │ 2 │ - │ 2.00 │ 2 │
│ Row 1 │ 1 │ - │ 1.00 │ 1 │
└────────────────────────────────────────┴─────┴─────┴──────┴─────┘
var ConsoleGrid = require("console-grid");
var grid = new ConsoleGrid();
var data = {
option: {
sortField: "name"
},
columns: [{
id: "name",
name: "Name",
type: "string",
maxWidth: 38
}, {
id: "value",
name: "Value",
type: "string",
maxWidth: 7,
formatter: (v, row, column) => {
return v;
}
}],
rows: [{
name: "Row 1",
value: "1"
}, {
name: "Row 2",
value: "2"
subs: [{
name: "Sub Row 1",
value: "s1"
}, {
name: "Sub Row 2",
value: "s2"
}]
}]
};
//returns lines could be saved to log file
var lines = grid.render(data);
option = {
border: {
h: '─',
v: '│',
top_left: '┌',
top_mid: '┬',
top_right: '┐',
mid_left: '├',
mid_mid: '┼',
mid_right: '┤',
bottom_left: '└',
bottom_mid: '┴',
bottom_right: '┘'
},
silent: false,
hideHeaders: false,
padding: 1,
defaultMinWidth: 1,
defaultMaxWidth: 30,
sortField: "",
sortAsc: false,
treeId: "name",
treeIcon: "├ ",
treeLink: "│ ",
treeLast: "└ ",
treeIndent: " ",
defaultTreeFormatter: this.defaultTreeFormatter,
defaultFormatter: this.defaultFormatter,
nullPlaceholder: "-"
}
console.log(grid.defaultOption());
column = {
id: String,
name: String,
type: String, //string, number
align : String, //left, right
minWidth: Number,
maxWidth: Number,
formatter: Function //cell formatter
}
row = {
//column id key: cell value
subs: Array //sub rows
}
var ConsoleGrid = require("console-grid");
var CGS = ConsoleGrid.Style;
//'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'
console.log(CGS.red("Red"));
console.log(CGS.bg.green("bg green"));
npm run test
FAQs
Console log a grid
The npm package console-grid receives a total of 228,039 weekly downloads. As such, console-grid popularity was classified as popular.
We found that console-grid demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.