-
Notifications
You must be signed in to change notification settings - Fork 932
Closed
Labels
Description
Describe the Feature
Now that console.log is forwarded to the CLI, we should think about formatting those logs to be easily readable in the terminal.
Possible Implementations
Here is an idea of displaying arrays and objects to the console using some basic ASCII graphics. (The format below is loosely based upon console.table and csvkit.)
I tried to make to design this formatting style with nesting in mind, as it is very common to nest JS objects.
console.log([true, false]);
(index) | Values
0 | true
1 | false
console.log({firstName: "Erica", lastName: "Smith"});
(index) | Values
firstName | "Erica"
lastName | "Smith"
console.log([{firstName: "Monica", lastName: "Johnson"}, {firstName: "Erica", lastName: "Smith"}]);
(index) | firstName | lastName
0 | "Monica" | "Johnson"
1 | "Erica" | "Smith"
console.log([22, {firstName: "Erica", lastName: "Smith"}, 34]);
(index) | Values
0 | 22
1 | firstName: "Erica"
| lastName: "Smith"
2 | 34
Related Issues
lucasbento, todorone, heyman333, muhammedubeyd, olawalejuwonm and 1 more