# async-storage-tree

> Use React's async-storage to create a tree of objects.

Latest version **0.0.3** (published 2018-06-23) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install async-storage-tree
pnpm add async-storage-tree
yarn add async-storage-tree
bun add async-storage-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.0.3 |
| Published | 2018-06-23 |
| First published | 2018-06-21 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | elsehow |
| Maintainers | elsehow |

## Links

- npm: https://www.npmjs.com/package/async-storage-tree
- Repository: https://github.com/elsehow/async-storage-tree
- Homepage: https://github.com/elsehow/async-storage-tree#readme
- Issues: https://github.com/elsehow/async-storage-tree/issues
- npm.io page: https://npm.io/package/async-storage-tree

## Dependencies (1)

- [uuid](https://npm.io/package/uuid.md) ^3.2.1

## Recent versions

- 0.0.3 (latest) — 2018-06-23
- 0.0.2 — 2018-06-23
- 0.0.1 — 2018-06-21

## README

# async-storage-tree

Use React's [async-storage](https://facebook.github.io/react-native/docs/asyncstorage.html)
to create a tree of objects.

**WIP** - Use at your own peril!

## install

`npm install async-storage-tree`

## example

```js
// TODO
```

## api

- `createRoot(obj): Promise`

Set obj as the root.
Any existing items in `asyncStorage` will go untouched.

NOTE - If there is an existing root, its children will be orphaned! We
recommend to .removeChild() first. (If no arguments are passde to
removeChild(), the whole tree will be removed, including children of the
root).

- `getRoot(): Promise[Object]`

Gets root of tree, returns a Promise.

- `createChild(obj, parentId): Promise`

Create `obj` as a new child of the leaf node with a given `id`.
If no `id` is specified, will create child of the root node.

- `getChildren(id): Promise[List[Object]]`

Get children of node with `id`.
If no `id` specified, gets the children of the root node.

- `removeChild(id): Promise`

Recursively delete nodes (i.e., id and all children).

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