Create ascii text trees from multidimensional arrays
Installation
$ npm install --save ascii-tree-array
Usage
const asciiTree = const data = 'foo' 'bar' 'baz' 'qux' 'qui' asciiTree// => #foo\r\n##bar\r\n##baz\r\n###qux\r\n###qui asciiTree// =>foo├─ bar└─ baz ├─ qux └─ qui
API
asciiTree.tree(array)
=> **Returns** `String`
When passing in an array, there should be only one value that is to be your root. For example:
[
'home',
[
'sean'
]
]
is allowed. However,
[
'home',
'sean',
[
'projects'
]
]
is not. This is because there can only be a single root to the tree.
asciiTree.list(array)
=> Returns String
This will return a raw bullet list of your array.
License
MIT © Sean Wilson