Convert string represented tree back into the structured JSON
npm install -g reverse-tree
reverse-tree <preset>
reverse-tree reads stdin.
tree
(default)clang
tree | reverse-tree | jq
clang -Xclang -ast-dump ViewController.m -fno-color-diagnostics | reverse-tree clang | jq
.
├── LICENSE.txt
├── README.md
├── lib
│ ├── mime-type.js
│ ├── parser.js
│ ├── serializer.js
│ └── utils.js
└── package.json
1 directory, 7 files
{
"text": ".",
"children": [
{
"text": "LICENSE.txt",
"children": []
},
{
"text": "README.md",
"children": []
},
{
"text": "lib",
"children": [
{
"text": "mime-type.js",
"children": []
},
{
"text": "parser.js",
"children": []
},
{
"text": "serializer.js",
"children": []
},
{
"text": "utils.js",
"children": []
}
]
},
{
"text": "package.json",
"children": []
}
]
}
reverseTree(input, options)
Options {
verticalLine: string
singleJoint: string
multiJoint: string
}