# couchr

> Lightweight XHR wrapper for CouchDB requests

Latest version **0.0.16** (published 2014-11-10) · 0 weekly downloads

## Install

```sh
npm install couchr
pnpm add couchr
yarn add couchr
bun add couchr
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.16 |
| Published | 2014-11-10 |
| First published | 2012-09-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Maintainers | caolan |

## Links

- npm: https://www.npmjs.com/package/couchr
- Repository: https://github.com/caolan/couchr
- Issues: https://github.com/caolan/couchr/issues
- npm.io page: https://npm.io/package/couchr

## Dependencies (1)

- [follow](https://npm.io/package/follow.md) 0.11.3

## Recent versions

- 0.0.16 (latest) — 2014-11-10
- 0.0.15 — 2014-08-28
- 0.0.14 — 2013-07-19
- 0.0.13 — 2013-04-17
- 0.0.12 — 2013-02-05
- 0.0.11 — 2013-02-04
- 0.0.9 — 2012-10-18
- 0.0.8 — 2012-09-11
- 0.0.7 — 2012-09-10
- 0.0.6 — 2012-09-08
- 0.0.5 — 2012-09-04

## README

# couchr

Simple request library for CouchDB. Provides both a Node.js module and a
browser module (based on jQuery.ajax), with better CouchDB error reporting
and a simpler API than making XHR requests directly in the browser.


### Examples

```javascript
// browser
require(['couchr'], function (couchr) {
    couchr.get('/dbname/docid', function (err, doc) {
        ...
    });
});

// Node
var couchr = require('couchr');
couchr.get('http://hostname:port/dbname/docid', function (err, doc) {
    ...
});
```

### Methods

```javascript
couchr.get (url, /*optional*/params, function (err, res, req) { ... })
couchr.post(url, /*optional*/data,   function (err, res, req) { ... })
couchr.put (url, /*optional*/data,   function (err, res, req) { ... })
couchr.del (url, /*optional*/data,   function (err, res, req) { ... })
couchr.head(url, function (err, res, req) { ... })

couchr.copy(from, to, function (err, res, req) { ... }) 

var feed = couchr.changes(db_url);
feed.on('change', function (change_object) { ...  });
feed.on('error', function (err) { ...  });
feed.pause();
feed.resume();
```

### Installation

Browser (using [jam](http://jamjs.org)):

    jam install couchr

Node (using [npm](http://npmjs.org)):

    npm install couchr

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