pretty-tree
Make colorful trees out of JSON objects using archy
npm install pretty-tree
Usage
var tree = require('pretty-tree');
var str = tree({
label: '(root)',
nodes: [{
label: '(child)',
leaf: {
hello: 'world',
hej: 'verden'
}
}]
});
console.log(str);
The above example results in the following output:
The node passed to tree can contain the following options
tree({
label: '(child)',
leaf: {
key: value,
...
},
nodes: [
child_nodes_with_same_structure
]
})
If you want to disable coloring (even when the terminal is a tty) use tree.plain(options)
License
MIT