archy / 1.0.0 last updated a year ago created on Mar 8th 2012
Install
npm install --save archy
Clone
git clone git@github.com:substack/node-archy.git
dependencies
No dependencies listed.
maintainers
versions
| 1.0.0 | 2 years ago | substack |
| 0.0.2 | 4 years ago | substack |
| 0.0.1 | 4 years ago | substack |
| 0.0.0 | 4 years ago | substack |
readme
archy
Render nested hierarchies npm ls style with unicode pipes.
example
output
methods
var archy = require('archy')
archy(obj, prefix='', opts={})
Return a string representation of obj with unicode pipe characters like how
npm ls looks.
obj should be a tree of nested objects with 'label' and 'nodes' fields.
'label' is a string of text to display at a node level and 'nodes' is an
array of the descendents of the current node.
If a node is a string, that string will be used as the 'label' and an empty
array of 'nodes' will be used.
prefix gets prepended to all the lines and is used by the algorithm to
recursively update.
If 'label' has newlines they will be indented at the present indentation level
with the current prefix.
To disable unicode results in favor of all-ansi output set opts.unicode to
false.
install
With npm do:
license
MIT
