Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antonmedv/asciitree
Draw vertical ASCII tree
https://github.com/antonmedv/asciitree
Last synced: 3 months ago
JSON representation
Draw vertical ASCII tree
- Host: GitHub
- URL: https://github.com/antonmedv/asciitree
- Owner: antonmedv
- License: mit
- Created: 2015-06-17T12:20:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-14T14:42:34.000Z (over 9 years ago)
- Last Synced: 2024-10-14T19:43:50.634Z (4 months ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 39
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ascii - asciitree
README
# Draw ASCII tree
```
npm install asciitree
```## Usage
```js
var draw_tree = require('./asciitree');var tree = ['root', 'child 1', ['child 2', 'node']];
console.log(draw_tree(tree));
```
Result:
```
root___
/ \
child 1 child 2
|
node
```## Examples
```
1___
/ \
2 3
/ \ / \
4 5 6 7
/ \ / \
8 9 10 11
``````
SELECT_________________
/ \ \
.___ FROM JOIN
/ \ | / \
a city_name people address ON
|
=___________
/ \
.____ .
/ \ / \
p address_id a id
``````
div_______________________________________________________________________________
/ \ \ \ \ \ \
text div_________________ text div_________________ text div_________________ text
/ \ \ \ \ / \ \ \ \ / \ \ \ \
text i text span text text i text span text text i text span text
| | |
text text text
```