# basic-tree

> A one-dimensional immutable tree structure that can generate and traverse an n-branching tree

Latest version **1.2.3** (published 2016-01-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install basic-tree
pnpm add basic-tree
yarn add basic-tree
bun add basic-tree
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2016-01-24 |
| First published | 2015-10-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stephen Standridge |
| Maintainers | stephen.standridge |

## Links

- npm: https://www.npmjs.com/package/basic-tree
- Repository: https://github.com/stephen-standridge/basic-tree
- Homepage: https://github.com/stephen-standridge/basic-tree#readme
- Issues: https://github.com/stephen-standridge/basic-tree/issues
- npm.io page: https://npm.io/package/basic-tree

## Dependencies (1)

- [immutable](https://npm.io/package/immutable.md) ^3.7.5

## Recent versions

- 1.2.3 (latest) — 2016-01-24
- 1.2.2 — 2016-01-24
- 1.2.1 — 2015-12-18
- 1.2.0 — 2015-12-15
- 1.1.9 — 2015-12-11
- 1.1.8 — 2015-12-10
- 1.1.7 — 2015-12-09
- 1.1.6 — 2015-12-09
- 1.1.5 — 2015-12-09
- 1.1.4 — 2015-12-07
- 1.1.2 — 2015-11-29
- 1.1.1 — 2015-11-29
- 1.1.0 — 2015-11-29
- 1.0.6 — 2015-11-13
- 1.0.5 — 2015-11-13
- … 5 more at https://npm.io/package/basic-tree/versions

## README

#Basic-Tree

An n-branching tree interface representing a list of data. 


##Installation
```
npm install basic-tree
```

##Usage

```
import Tree from 'basic-tree';

let tree = new Tree({config:{branches: 3}})
/* creates a tree with three branches */

tree.node = 1;

tree.toFirst()
tree.node = 2;

tree.parent

tree.toLast()
tree.node = 3;

tree.toJS()
/* prints [1,2,,3]

```

###Navigation

####toNth() //0 indexed
####toFirst()
####toLast()
####root
####parent

###Setters

####root
####node
####children
####parent

###Traversal

#####preOrderDepth( callback )
#####postOrderDepth( callback )
#####preOrderBreadth( callback )

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