# ember-cli-couch

> CouchDB API for Ember.js

Latest version **1.0.14** (published 2017-11-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-cli-couch
pnpm add ember-cli-couch
yarn add ember-cli-couch
bun add ember-cli-couch
```

## 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 | 1.0.14 |
| Published | 2017-11-21 |
| First published | 2017-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | ampatspell |
| Keywords | ember-addon, couchdb, json, api, database, nosql |

## Links

- npm: https://www.npmjs.com/package/ember-cli-couch
- Repository: https://github.com/ampatspell/ember-cli-couch
- Homepage: https://github.com/ampatspell/ember-cli-couch#readme
- Issues: https://github.com/ampatspell/ember-cli-couch/issues
- npm.io page: https://npm.io/package/ember-cli-couch

## Dependencies (4)

- [blob-util](https://npm.io/package/blob-util.md) 1.3.0
- [broccoli-stew](https://npm.io/package/broccoli-stew.md) 1.5.0
- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) 6.8.2
- [broccoli-templater](https://npm.io/package/broccoli-templater.md) 1.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.14 (latest) — 2017-11-21
- 1.0.13 — 2017-11-20
- 1.0.12 — 2017-11-01
- 1.0.11 — 2017-10-26
- 1.0.10 — 2017-10-22
- 1.0.9 — 2017-10-16
- 1.0.8 — 2017-10-07
- 1.0.7 — 2017-10-06
- 1.0.6 — 2017-10-06
- 1.0.5 — 2017-10-04
- 1.0.4 — 2017-10-04
- 1.0.3 — 2017-08-03
- 1.0.2 — 2017-07-19
- 1.0.0 — 2017-07-01
- 0.0.13 — 2017-06-27
- … 11 more at https://npm.io/package/ember-cli-couch/versions

## README

# ember-cli-couch

Addon for CouchDB document API.

```
$ ember install ember-cli-couch
```

## Setup

``` javascript
// instance-initializers/databases.js
import { registerDatabaseServices } from 'couch';

export default {
  name: 'thing:databases',
  initialize(app) {

    registerDatabaseServices(app, {
      db: {
        url: 'http://127.0.0.1:5984',
        name: 'thing'
      }
    });

    app.lookup('service:db'); // => <thing@couch:database::ember362>
  }
};

```

## Usage

``` javascript
// routes/index.js
import Ember from 'ember';

const {
  RSVP: { hash }
} = Ember;

export default Ember.Route.extend({
  model() {
    return hash({
      database: this.get('db').info(),
      couch:    this.get('db.couch').info(),
      session:  this.get('db.couch.session').load(),
      url:      this.get('db.url')
    });
  }
});
```

## API

> Full documentation coming soon.

```
couches
  couch
    couches
    url
    normalizedUrl
    session
      load()
      save(name, password)
      delete()
    request(opts)
    info()
    uuids(count)
    changes(opts)
    database(name)
      couch
      name
      url
      changes(opts)
      security
        load()
        save(body)
      design
        id(name)
        load(name, opts)
        save(name, json)
        delete(name, opts)
      database
        info()
        create(opts)
        delete(opts)
        recreate(opts)
      mango
        find(opts)
        explain(opts)
        save(ddoc, name, index)
        all()
        delete()
      info()
      load(id, opts)
      save(doc, opts)
      delete(id, rev, opts)
      view(ddoc, name, opts)
      all(opts)
```

## Dummy

See dummy for usage examples and play with `window.db`:

``` javascript
> db.load('first').then(log)
```

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