# @aspen.cloud/aspendb

> Your unified, personal database to store data for many applications.

Latest version **0.3.6** (published 2020-03-31) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @aspen.cloud/aspendb
pnpm add @aspen.cloud/aspendb
yarn add @aspen.cloud/aspendb
bun add @aspen.cloud/aspendb
```

## 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.3.6 |
| Published | 2020-03-31 |
| First published | 2020-03-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matthew Linkous |
| Maintainers | matlin95 |
| Keywords | database, sqllite, api, personal, private, couchdb, pouchdb, aspen, cloud |

## Links

- npm: https://www.npmjs.com/package/@aspen.cloud/aspendb
- Repository: https://github.com/aspen-cloud/aspendb
- Homepage: https://github.com/aspen-cloud/aspendb#readme
- Issues: https://github.com/aspen-cloud/aspendb/issues
- npm.io page: https://npm.io/package/@aspen.cloud/aspendb

## Dependencies (12)

- [tslib](https://npm.io/package/tslib.md) ^1
- [pouchdb](https://npm.io/package/pouchdb.md) ^7.2.1
- [shortid](https://npm.io/package/shortid.md) ^2.2.15
- [@types/node](https://npm.io/package/@types/node.md) ^13.7.7
- [pouchdb-find](https://npm.io/package/pouchdb-find.md) ^7.2.1
- [@types/pouchdb](https://npm.io/package/@types/pouchdb.md) ^6.4.0
- [@types/shortid](https://npm.io/package/@types/shortid.md) 0.0.29
- [pouchdb-upsert](https://npm.io/package/pouchdb-upsert.md) ^2.2.0
- [pouchdb-collate](https://npm.io/package/pouchdb-collate.md) ^7.2.1
- [platform-folders](https://npm.io/package/platform-folders.md) ^0.4.1
- [@types/pouchdb-upsert](https://npm.io/package/@types/pouchdb-upsert.md) ^2.2.6
- [pouchdb-adapter-node-websql](https://npm.io/package/pouchdb-adapter-node-websql.md) ^7.0.0

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 0.3.6 (latest) — 2020-03-31
- 0.3.5 — 2020-03-31
- 0.3.4 — 2020-03-30
- 0.3.3 — 2020-03-30
- 0.3.2 — 2020-03-30
- 0.3.1 — 2020-03-21
- 0.3.0 — 2020-03-19
- 0.2.2 — 2020-03-06
- 0.2.1 — 2020-03-06
- 0.2.0 — 2020-03-06
- 0.1.4 — 2020-03-04
- 0.1.3 — 2020-03-04
- 0.1.2 — 2020-03-04
- 0.1.1 — 2020-03-04
- 0.1.0 — 2020-03-04

## README

# AspenDB
AspenDB is a database designed to capture the data from the apps and services you use like Spotify, Gmail, and more.

Made by the folks at [Aspen](https://aspen.cloud)

## Key Features
- Multiple apps in one database
- Store any JSON data
- Sync to Aspen Cloud or any CouchDB instance to make your data available anywhere

## Getting started
The fastest way to start using AspenDB for your own data is to use [Aspen CLI](https://github.com/aspen-cloud/aspen-cli)

### Installation
Install with NPM or Yarn

`npm i @aspen.cloud/aspendb`

`yarn add @aspen.cloud/aspendb`

You might also need to install `gcc` for the some of the dependencies. 

### Import Aspen Local

```javascript
import AspenLocalDB from '@aspen.cloud/aspendb';
const aspendb = new AspenLocalDB();
```

### Add data for your apps
```javascript
await aspendb.app('my-notes').add({title: 'Data Ownership', body: 'In the future, users should own and control their data.'})
await aspendb.app('my-notes').add({title: 'Music Library', body: 'I need to make a universal music library that includes Spotify and Soundcloud.'})

await aspendb.app('music').add(aspendb.app('music').add({type: 'track', title: 'Nights', artist: 'Frank Ocean' }););
await aspendb.app('music').add({type: 'album', title: 'Coloring Book', artist: 'Chance the Rapper' });
```

### Get your data 
```javascript
await aspendb.app('music').all();
// Return all documents in 'music'
```
or get *all* of your data
```javascript
// aspendb.global gives you a reference to the underlying PouchDB instance
await aspendb.global.allDocs();
// Returns all documents from 'music' and 'my-notes'
```

### Query your data
```javascript
const trackQuery = { selector: { type: { $eq: "tracks" } } };
await aspendb.app('music').find(trackQuery);
// Returns tracks from your collection 'music'
```

## Technologies used
- Written in **Typescript**
- **PouchDB**, under the hood, to handle syncing and querying.
- **SQLite** as the storage engine used locally.

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