archy 1.0.0

render nested hierarchies `npm ls` style with unicode pipes


Platform: npm

Language: JavaScript

License: MIT

Keywords: hierarchy, npm ls, unicode, pretty, print

View on registry:

Direct download link:

Install: npm install [email protected]


Render nested hierarchies npm ls style with unicode pipes.

browser support

build status


var archy = require('archy');
var s = archy({
  label : 'beep',
  nodes : [
      label : 'boop',
      nodes : [
          label : 'o_O',
          nodes : [
              label : 'oh',
              nodes : [ 'hello', 'puny' ]


├── ity
└─┬ boop
  ├─┬ o_O
  │ ├─┬ oh
  │ │ ├── hello
  │ │ └── puny
  │ └── human
  └── party


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.


With npm do:

npm install archy





1.0.0 September 14, 2014
0.0.2 March 08, 2012
0.0.1 March 08, 2012
0.0.0 March 08, 2012

Project Statistics

SourceRank 19
Dependencies 0
Dependent projects 239
Dependent repositories 5.75K
Total releases 4
Latest release
First release
Stars 140
Forks 7
Watchers 4
Contributors 1
Repo Size: 158 KB

Top Contributors See all

James Halliday

Something wrong with this page? Make a suggestion

Export .ABOUT file for this library

Last synced: 2017-02-09 03:50:16 UTC

Login to resync this project