# string-tree

> Navigate a tree of unique strings

Latest version **0.7.0** (published 2016-12-01) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2016-12-01 |
| First published | 2016-12-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | erikpukinskis |

## Links

- npm: https://www.npmjs.com/package/string-tree
- npm.io page: https://npm.io/package/string-tree

## Recent versions

- 0.7.0 (latest) — 2016-12-01
- 0.6.0 — 2016-12-01

## README

This library is useful if you want to ask some questions about a tree structure.

    var StringTree = require("string-tree")
    var tree = new StringTree()

You just provide a string and then an array of strings that identify that string's children.

    tree.add("Linda", ["Susan"])
    tree.add("Susan", ["Jennifer"])
    tree.add("Jennifer", ["Madison"])

    tree.ancestors("Madison") 

    # returns ["Linda", "Susan", "Jennifer"]

It's sort of different from other similar libraries in that it's only a tree of identifiers, so if you add the same one in two places, that's considered the same node.

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