# homestar-persist

> IOTDB module to persist Thing data to disk

Latest version **3.0.4** (published 2016-10-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install homestar-persist
pnpm add homestar-persist
yarn add homestar-persist
bun add homestar-persist
```

## 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 | 3.0.4 |
| Published | 2016-10-05 |
| First published | 2016-09-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David P. Janes |
| Maintainers | dpjanes |

## Links

- npm: https://www.npmjs.com/package/homestar-persist
- Repository: https://github.com/dpjanes/homestar-persist
- Homepage: https://github.com/dpjanes/node-iotdb
- Issues: https://github.com/dpjanes/homestar-persist/issues
- npm.io page: https://npm.io/package/homestar-persist

## Dependencies (4)

- [iotdb](https://npm.io/package/iotdb.md) >=3.0.0
- [iotdb-transport](https://npm.io/package/iotdb-transport.md) ~3.0.11
- [iotdb-transport-fs](https://npm.io/package/iotdb-transport-fs.md) ~3.0.6
- [iotdb-transport-iotdb](https://npm.io/package/iotdb-transport-iotdb.md) ~3.0.5

## Recent versions

- 3.0.4 (latest) — 2016-10-05
- 3.0.3 — 2016-09-19
- 3.0.2 — 2016-09-19

## README

# homestar-persist
[IOTDB](https://github.com/dpjanes/node-iotdb) module to persist Thing data to disk

<img src="https://raw.githubusercontent.com/dpjanes/iotdb-homestar/master/docs/HomeStar.png" align="right" />

# About

* This will persist (write to disk) all the data belonging to your Things.
* It will also allow modification of that data, which will be written back to the 
Things, e.g. to modify metadata or the state.
* It provides CLI tools to modify state

## Files

Files are persisted in `.iotdb/things`. After you've played with this
it's worth looking at what it's actually storing.

# Installation and Configuration

* [Read this first](https://github.com/dpjanes/node-iotdb/blob/master/docs/install.md)

If you want to use the CLI tools (you probably do), also install Home☆Star:

* [Read about installing Home☆Star](https://github.com/dpjanes/node-iotdb/blob/master/docs/homestar.md) 

Then:

    $ npm install homestar-persist

# Use
## Tracking IOTDB installation

    const iotdb = require("iotdb")

    // e.g. connect to stuff
    iotdb.use("homestar-wemo");
    iotdb.connect("WeMoSocket");

    // this is the magic
    iotdb.use("homestar-persist");

That's it! If you look in `.iotdb/things` you'll see 
all the Things that IOTDB discovers listed here, one
folder per `id` and then one JSON file per **band**.

## In Home☆Star

Just add the following to `boot/index.js` after you've
set up Home☆Star:

    iotdb.use("homestar-persist");

# Command Line

## `things`

This will list everything this module knows about your Things:

    $ homestar things

Note that 

## `put`

To get all the options, try

    $ homestar put --help

The naming convention for keys, e.g. `meta/schema:name` will make more
sense if you try `homestar things` first

Turn on Thing named 'WeMo Switch' (`--boolean` is optional here because 
IOTDB's type coercion system will Do The Right Thing)

    $ homestar put --boolean --name 'WeMo Switch' :on true

Rename the Thing with id 'urn:iotdb:t:sArvozfc:092qoWwd'

    $ homestar put --id 'urn:iotdb:t:sArvozfc:092qoWwd' meta/schema:name 'New Name'

Turn off everything

    $ homestar put --all :on 0

Turn on Things that are made by Belkin.

    $ homestar put --select meta/schema:manufacturer=http://www.belkin.com/ :on 1

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