# console-log-tree

> Log the tree of array or object

Latest version **1.2.1** (published 2019-05-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install console-log-tree
pnpm add console-log-tree
yarn add console-log-tree
bun add console-log-tree
```

## Health

**Score 18/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2019-05-03 |
| First published | 2019-05-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/console-log-tree) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Qi |
| Maintainers | qishaoxuan |

## Links

- npm: https://www.npmjs.com/package/console-log-tree
- Repository: https://github.com/QiShaoXuan/log-tree
- Homepage: https://github.com/QiShaoXuan/log-tree#readme
- Issues: https://github.com/QiShaoXuan/log-tree/issues
- npm.io page: https://npm.io/package/console-log-tree

## Recent versions

- 1.2.1 (latest) — 2019-05-03
- 1.1.1 — 2019-05-03
- 1.0.1 — 2019-05-03
- 1.0.0 — 2019-05-03

## README

# console-log-tree

Log the tree of an array or object

## Example

#### Input

```js
[
  {
    "name": "photos",
    "children": [
      {
        "name": "summer",
        "children": [
          {
            "name": "june",
            "children": [
              {
                "name": "windsurf.jpg",
              }
            ]
          }
        ]
      },
      {
        "name": "winter",
        "children": [
          {
            "name": "january",
            "children": [
              {
                "name": "ski.png",
              },
              {
                "name": "snowboard.jpg",
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "name":'doc'
  }
]
```

#### Output

```html
├── photos
│   ├── summer
│   │   └── june
│   │       └── windsurf.jpg
│   └── winter
│       └── january
│           ├── ski.png
│           └── snowboard.jpg
└── doc
```

## Use

```bash
npm install console-log-tree
```

```js
const logTree = require('console-log-tree')

const tree = {...}

const treeStr = logTree.parse(tree)

console.log(treeStr)

// OR

logTree.log(tree)
```

---
_Source: https://npm.io/package/console-log-tree · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
