# quercus

> Simple and dynamic tree data structures in TypeScript

Latest version **2.3.0** (published 2019-10-20) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install quercus
pnpm add quercus
yarn add quercus
bun add quercus
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2019-10-20 |
| First published | 2017-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 126.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Felix Rilling |
| Maintainers | felixrilling |
| Keywords | tree, data-structure |

## Links

- npm: https://www.npmjs.com/package/quercus
- Repository: https://github.com/FelixRilling/quercus
- Homepage: https://github.com/FelixRilling/quercus#readme
- Issues: https://github.com/FelixRilling/quercus/issues
- npm.io page: https://npm.io/package/quercus

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [lightdash](https://npm.io/package/lightdash.md) ^11.1.1
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.136

## Recent versions

- 2.3.0 (latest) — 2019-10-20
- 3.0.0-0 (next) — 2019-10-22
- 2.2.10 — 2018-10-31
- 2.2.9 — 2018-06-27
- 2.2.8 — 2018-06-27
- 2.2.7 — 2018-05-29
- 2.2.6 — 2018-04-27
- 2.2.5 — 2018-04-04
- 2.2.4 — 2018-04-04
- 2.2.3 — 2018-02-10
- 2.2.2 — 2018-02-10
- 2.2.1 — 2018-02-04
- 2.2.0 — 2018-01-20
- 2.1.0 — 2017-12-29
- 2.0.0 — 2017-12-27
- … 1 more at https://npm.io/package/quercus/versions

## README

# Quercus

> Simple and dynamic tree data structures in TypeScript

## Introduction

Quercus allows you to create tree data structures of any size and depth.
The `Quercus` class extends `Map`,meaning you can use methods like `forEach` or `values` on it.
Even though the examples use strings as path items, any data type accepted as a Map key can be used.

**[Docs](https://felixrilling.github.io/quercus/)**

## Usage

```shell
npm install quercus
```

### Example

```typescript
import {Quercus} from "quercus";

const tree = new Quercus();

tree.setPath(["foo", "bar"], 5);
tree.setPath(["foo", "bizz"], 12);
tree.setPath(["bar", "fazz"], 560);
```

Creates a tree like this:

```text
        tree
        /  \
      foo   bar
      / \     \
    bar bizz  fazz
     |   |      |
     5   12    560
```

You could also create the paths in the constructor:

```typescript
import {Quercus} from "quercus";

const tree = new Quercus([
    [["foo", "bar"], 5],
    [["foo", "bizz"], 12],
    [["bar", "fazz"], 560]
]);
```

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