<commit_before># ember-cli-couch

This README outlines the details of collaborating on this Ember addon.

## Installation

* `git clone <repository-url>` this repository
* `cd ember-cli-couch`
* `npm install`

## Running

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).

## Running Tests

* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`

## Building

* `ember build`

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
<commit_msg>minimal readme<commit_after># 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)
    database(name)
      couch
      name
      url
      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)
```

{'fraction_non_alphanumeric': 0.14599193909538738, 'fraction_numerical': 0.009404388714733543, 'mean_word_length': 2.4106870229007633, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4751443', 'n_tokens_mistral': 771, 'n_tokens_neox': 742, 'n_words': 176}