0.1.0 • Published 2 years ago

@lunjs/archy v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 years ago

@lunjs/archy

Installation

npm install @lunjs/archy

Usage

const archy = require('@lunjs/archy');
const s = archy.draw({
  label : 'beep',
  nodes : [
    'ity',
    {
      label : 'boop',
      nodes : [
        {
          label : 'o_O',
          nodes : [
            {
              label : 'oh',
              nodes : [ 'hello', 'puny' ]
            },
            'human'
          ]
        },
        'party\ntime!'
      ]
    }
  ]
});
console.log(s);

Output

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

Options

KeyValue
styledefault is 'NPM', support 'NPM' or 'FMW'
labeldefault is 'label', support function
nodesdefault is 'nodes', support function
unicodedefault is true
drawRootBranchdefault is false
prefixdefault is ''
concurrencydefault is Infinity, only for drawAsync

Inspired by

License