0.5.0 |
|
---|
#39 在 #format-json
32KB
809 代码行
📺 tv
将 JSON 格式化为表格视图
用法
$ cat example.json
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "[email protected]",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
},
...
]
$ tv test.json
+-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
|address|company|email |id|name |phone |username |website |
+-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
|... |... |[email protected] |1 |Leanne Graham |1-770-736-8031 x56442|Bret |hildegard.org|
|... |... |[email protected] |2 |Ervin Howell |010-692-6593 x09125 |Antonette |anastasia.net|
|... |... |[email protected] |3 |Clementine Bauch |1-463-123-4447 |Samantha |ramiro.info |
|... |... |[email protected]|4 |Patricia Lebsack |493-170-9623 x156 |Karianne |kale.biz |
|... |... |[email protected] |5 |Chelsey Dietrich |(254)954-1289 |Kamren |demarco.info |
|... |... |[email protected] |6 |Mrs. Dennis Schulist |1-477-935-8478 x6430 |Leopoldo_Corkery|ola.org |
|... |... |[email protected] |7 |Kurtis Weissnat |210.067.6132 |Elwyn.Skiles |elvis.io |
|... |... |[email protected] |8 |Nicholas Runolfsdottir V|586.493.6943 x140 |Maxime_Nienow |jacynthe.com |
|... |... |[email protected] |9 |Glenna Reichert |(775)976-6794 x41206 |Delphine |conrad.com |
|... |... |[email protected] |10|Clementina DuBuque |024-648-3804 |Moriah.Stanton |ambrose.net |
+-------+-------+-------------------------+--+------------------------+---------------------+----------------+-------------+
运行 tv --help
查看详细用法。
如何安装
对于 MacOS
$ brew install uzimaru0000/tap/tv
依赖项
~6–13MB
~123K SLoC