# then-couchdb

> A promise-based CouchDB client

Latest version **0.4.4** (published 2014-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install then-couchdb
pnpm add then-couchdb
yarn add then-couchdb
bun add then-couchdb
```

## 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.4.4 |
| Published | 2014-04-09 |
| First published | 2013-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 0.10.x |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Michael Jackson |
| Maintainers | mjackson |
| Keywords | couchdb, couch, then, promise, promises |

## Links

- npm: https://www.npmjs.com/package/then-couchdb
- Repository: https://github.com/mjijackson/then-couchdb
- Issues: https://github.com/mjijackson/then-couchdb/issues
- npm.io page: https://npm.io/package/then-couchdb

## Dependencies (2)

- [rsvp](https://npm.io/package/rsvp.md) 3.0.x
- [then-redis](https://npm.io/package/then-redis.md) 0.3.x

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 0.4.4 (latest) — 2014-04-09
- 0.4.3 — 2013-10-28
- 0.4.2 — 2013-10-26
- 0.4.1 — 2013-07-27
- 0.4.0 — 2013-07-25
- 0.3.9 — 2013-06-07
- 0.3.8 — 2013-05-31
- 0.3.7 — 2013-05-30
- 0.3.6 — 2013-04-24
- 0.3.5 — 2013-04-20
- 0.3.4 — 2013-04-17
- 0.3.3 — 2013-04-17
- 0.3.2 — 2013-04-16
- 0.3.1 — 2013-04-16
- 0.3.0 — 2013-04-16
- … 3 more at https://npm.io/package/then-couchdb/versions

## README

then-couchdb
============

[then-couchdb](https://github.com/mjijackson/then-couchdb) is a promise-based [CouchDB](http://couchdb.apache.org) client for [node.js](http://nodejs.org). It supports all the features of CouchDB in a simple, user-friendly package.

### Usage

Creating a client.

```js
var couchdb = require('then-couchdb');
var db = couchdb.createClient('http://localhost:5984/my-database');
```

Save and fetch a single document.

```js
db.save({ name: 'one' }).then(function (doc) {
  assert(doc);
  assert(doc._id);
  assert(doc._rev);

  db.get(doc._id).then(function (doc) {
    assert(doc);
    assert.equal(doc.name, 'one');
  });
});
```

Save and fetch many documents in bulk.

```js
db.saveAll([
  { name: 'one' },
  { name: 'two' },
  { name: 'three' }
]).then(function (docs) {
  assert(Array.isArray(docs));
  assert.equal(docs.length, 3);

  var keys = docs.map(function (doc) {
    return doc._id;
  });

  db.getAll(keys).then(function (docs) {
    assert(Array.isArray(docs));
    assert.equal(docs.length, 3);
  });
});
```

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