New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

feathers-pouchdb

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-pouchdb

PouchDB feathers service.

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-81.82%
Maintainers
1
Weekly downloads
 
Created
Source

feathers-pouchdb

Dependency Status Download Status

Create a PouchDB service for FeatherJS.

Installation

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

Documentation

Please refer to the Feathers database adapter documentation for more details or directly at:

  • PouchDB - The detailed documentation for this adapter
  • Extending - How to extend a database adapter
  • Pagination and Sorting - How to use pagination and sorting for the database adapter
  • Querying - 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.

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. 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.

Keywords

FAQs

Package last updated on 13 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc