Created
September 14, 2020 14:18
-
-
Save antonmedv/04c179729852044e8bdf21aa959748e5 to your computer and use it in GitHub Desktop.
fx snippet for table output on JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global.table = (json) => { | |
let Table = require('cli-table3') | |
let table = new Table({head: Object.keys(json[0])}); | |
table.push(...json.map(Object.values)) | |
return table.toString() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment