【文件属性】:
文件名称:pretty-tree:使用 archy 从 JSON 对象中制作彩色树
文件大小:14KB
文件格式:ZIP
更新时间:2021-06-22 20:47:52
JavaScript
漂亮的树
使用从 JSON 对象中制作彩色树
npm install pretty-tree
用法
var tree = require ( 'pretty-tree' ) ;
var str = tree ( {
label : '(root)' , // the label of this node
nodes : [ {
label : '(child)' ,
leaf : {
hello : 'world' ,
hej : 'verden'
}
} ]
} ) ;
console . log ( str ) ;
上面的示例产生以下输出:
传递给树的节点可以包含以下选项
tree ( {
label : '(child)' , // an optional lable of this node
leaf : { // s
【文件预览】:
pretty-tree-master
----index.js(2KB)
----package.json(398B)
----LICENSE(1KB)
----example.js(791B)
----example.png(10KB)
----.gitignore(13B)
----README.md(906B)