# couchdb-indexer

> Create or update indexes for all of your CouchDB via a single command / call.

Latest version **0.1.2** (published 2016-03-09) · MIT license · 0 weekly downloads

## Install

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

Provides the command `ixcouch`.

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2016-03-09 |
| First published | 2016-02-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nick Cartwright |
| Maintainers | aslant |
| Keywords | couch, couchdb, cache, caching, database, active, tasks, _active_tasks, index, indexer, indexes, design, document, view, Q, Qouch, promise |

## Links

- npm: https://www.npmjs.com/package/couchdb-indexer
- Repository: https://github.com/mammaldev/couchdb-indexer
- Homepage: https://github.com/mammaldev/couchdb-indexer#readme
- Issues: https://github.com/mammaldev/couchdb-indexer/issues
- npm.io page: https://npm.io/package/couchdb-indexer

## Dependencies (3)

- [q](https://npm.io/package/q.md) ^1.1.2
- [qouch](https://npm.io/package/qouch.md) git://github.com/mammaldev/qouch.git#v0.5.0
- [minimist](https://npm.io/package/minimist.md) ^1.1.0

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2016-03-09
- 0.1.1 — 2016-03-02
- 0.1.0 — 2016-02-29

## README

# couchdb-indexer

Both a requireable module and a CLI tool for indexing (caching) CouchDB views.

The utility functions by retrieving a database's design documents and then requesting a single row from a single view on each design document. The effect is that all views are then indexed and results can be thereafter retrieved without delay.

Options exist to filter the design documents that are indexed and to limit the number of threads used for indexing.

## Module

```sh
$ npm install --save couchdb-indexer
```

### Usage

Works with both callbacks and promises.

```js
var ixcouch = require('couchdb-indexer');

// callback
ixcouch('http://localhost:5984/my-db', function ( err ) {
  // ...
});

// promise
ixcouch('http://localhost:5984/my-db').then(function () {
  // success
});
```

#### Options

Optionally pass an options object as the second argument. Properties:

- `[options.filter=null] {string|RegExp}`: Only index views on design docs whose names match RegExp
- `[options.maxActiveTasks=NaN] {integer}`: View queries are queued so as to attempt to limit the maximum number of concurrent active tasks on the CouchDB server.

## CLI

```sh
$ npm install -g couchdb-indexer
$ ixcouch my-db
```

### Usage

```sh
$ ixcouch [options] <database_url>
```

#### Options

```
  --filter=<string>
    Only index views on design docs whose names match JavaScript RegExp

  --max-active-tasks=<integer>
    View queries are queued so as to attempt to limit the maximum number of concurrent active tasks on the CouchDB server.
    Active tasks are queried via route: GET {server_url}/_active_tasks.

    By default, there is no maximum - i.e. all view queries are sent simultaneously.

DATABASE URL

    Can be supplied in various formats:

      Full URL

      {host}/{database_name} - inferred protocol: http

      :{port}/{database_name} - inferred protocol: http; inferred hostname: 127.0.0.1

      {database_name} - inferred protocol: http; inferred host: 127.0.0.1:5984
```

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