1.0.0 • Published 6 years ago
array-treefy v1.0.0
array-treefy
Display array in tree view
Install globally
$ npm i -g array-treefy
Install locally
$ npm i --save array-treefy
Use Programmatically
const arrayTreefy = require("array-treefy")
arrayTree([1, 2, [3, 4, 5], 6, 7], "x0")
Global usage
$ array-treefy "[1,2, [3,4], 5, [6, [7,8], 9], 10]" --label="xo"
Output
xo
├── 1
├── 2
├─┬ xo
│ ├── 3
│ └── 4
├── 5
├─┬ xo
│ ├── 6
│ ├─┬ xo
│ │ ├── 7
│ │ └── 8
│ └── 9
└── 10
API
arrayTreefy(data , label)
Returns a string.
data
Type: Array
label
Type: string
Default: --
License
MIT © Joydip Roy (rjoydip)
1.0.0
6 years ago