what's the best "thing" you have seen/read to turn...
# thinking-together
m
what's the best "thing" you have seen/read to turn a tree into a table? something like jq visual things more than welcome
m
Trusty
console.table
in Chrome Devtools does it
m
data already has to have a tabular structure
I mean flatten a subset of a deeply nested tree into a table
m
yeah for some reason I thought it did by concatenating key names as it recursed down an arbitrary but that must’ve been a different tool
t
underscore flatten or d3 merge ? quite often I just use reduce tho
m
not generic enough, I mean something like a graphql result or an ast
t
liek XPATH kinda thing
Oh I have used this one before https://www.npmjs.com/package/jsonpath, though I later found I could get away with underscores _.get(object, path, [default]) for my application
if you are doing complex queries it might be worth loading sqlite.js
or by table are you asking for a dataframe type thingy? https://github.com/uwdata/arquero I guess I am confused by what you are looking for. The term 'table' is ambiguous (SQL table, HTML Table, Mathematical Table) and hardly relates to jq in my world.
t
@dnmfarrell has a jq like module written in bash if you're using it in the command line. https://github.com/dnmfarrell/jp/