# feathers-pouchdb

> PouchDB feathers service.

Latest version **2.0.2** (published 2017-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install feathers-pouchdb
pnpm add feathers-pouchdb
yarn add feathers-pouchdb
bun add feathers-pouchdb
```

## 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 | 2.0.2 |
| Published | 2017-07-13 |
| First published | 2017-07-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.6.0 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Endy Jasmi |
| Maintainers | endyjasmi |
| Keywords | couchdb, pouchdb, feathers, feathers-plugin, feathers-pouchdb |

## Links

- npm: https://www.npmjs.com/package/feathers-pouchdb
- Repository: https://github.com/endyjasmi/feathers-pouchdb
- Issues: https://github.com/endyjasmi/feathers-pouchdb/issues
- npm.io page: https://npm.io/package/feathers-pouchdb

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^2.6.8
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [uberproto](https://npm.io/package/uberproto.md) ^1.2.0
- [feathers-errors](https://npm.io/package/feathers-errors.md) ^2.8.1
- [feathers-commons](https://npm.io/package/feathers-commons.md) ^0.8.7

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2017-07-13
- 2.0.1 — 2017-07-12
- 2.0.0 — 2017-07-12
- 1.0.10 — 2017-07-03
- 1.0.9 — 2017-07-03
- 1.0.3 — 2017-07-02
- 1.0.2 — 2017-07-02
- 1.0.1 — 2017-07-02
- 1.0.0 — 2017-07-02

## README

# feathers-pouchdb

[![Dependency Status](https://img.shields.io/david/endyjasmi/feathers-pouchdb.svg?style=flat-square)](https://david-dm.org/endyjasmi/feathers-pouchdb)
[![Download Status](https://img.shields.io/npm/dm/feathers-pouchdb.svg?style=flat-square)](https://www.npmjs.com/package/feathers-pouchdb)

> Create a [PouchDB](https://pouchdb.com/) service for [FeatherJS](https://feathersjs.com/).

## Installation

```
npm install pouchdb-core pouchdb-find pouchdb-adapter-leveldb feathers-pouchdb --save
```

## Documentation

Please refer to the [Feathers database adapter documentation](https://docs.feathersjs.com/api/databases/common.html) for more details or directly at:

- [PouchDB](https://pouchdb.com/api.html) - The detailed documentation for this adapter
- [Extending](https://docs.feathersjs.com/api/databases/common.html#extending-adapters) - How to extend a database adapter
- [Pagination and Sorting](https://docs.feathersjs.com/api/databases/common.html#pagination) - How to use pagination and sorting for the database adapter
- [Querying](https://docs.feathersjs.com/api/databases/querying.html) - The common adapter querying mechanism

### Limitation
- Currently this plugin **DOES NOT** fully support pagination because of the way CouchDB Mango Query is designed to make use map reduce index. The skip and limit does work though, just not the total attribute though.

## Complete Example

Here's an example of a Feathers server that uses `feathers-pouchdb`. 

```js
const PouchDBCore = require('pouchdb-core');
const PouchDBFind = require('pouchdb-find');
const PouchDBLevelDBAdapter = require('pouchdb-adapter-leveldb');
const feathers = require('feathers');
const rest = require('feathers-rest');
const hooks = require('feathers-hooks');
const bodyParser = require('body-parser');
const errorHandler = require('feathers-errors/handler');
const service = require('feathers-pouchdb');

const PouchDB = PouchDBCore.plugin(PouchDBLevelDBAdapter)
  .plugin(PouchDBFind);

// Initialize the application
const app = feathers()
  .configure(rest())
  .configure(hooks())
  // Needed for parsing bodies (login)
  .use(bodyParser.json())
  .use(bodyParser.urlencoded({ extended: true }))
  // Initialize your feathers service
  .use('/messages', service({ Model: new PouchDB('./messages') }))
  .use(errorHandler());

app.listen(3030);

console.log('Feathers app started on 127.0.0.1:3030');
```

You can run this example and going to [localhost:3030/messages](http://localhost:3030/messages). You should see an empty array. That's because you don't have any Todos yet but you now have full CRUD for your new messages service.

## License

Copyright (c) 2017

Licensed under the [MIT license](LICENSE).

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