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

backbone-pouch-collection

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone-pouch-collection

Backbone Collections with PouchDB as the data source

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-70.59%
Maintainers
1
Weekly downloads
 
Created
Source

backbone-pouch-collection

Hooks up PouchDB to a Backbone collection. Allows you to easily retrieve your data from CouchDB/PouchDB views.

Installation

npm install backbone-pouch-collection

Usage (with Browserify)

Define the query options in your collection definition. opts can be an object or a function which returns an object. You also need to provide a PouchDB instance to your collection.

opts.view can also be _all_docs to query...well... _all_docs.

The defaults are _all_docs and include_docs: true.

var PouchBase = require('backbone-pouch-collection')

var Collection = PouchBase.extend({
  db: new Pouchdb('foo'),
  opts: {
    view: 'your/viewname',
    params: {
      // all the (c/p)ouchdb view params you want
    }
  }

  myMethod: function () {}
})

You can also pass options to collection.fetch() to override the default.

// fetch() returns a promise
collection.fetch({
  couch: {
    // all the (c/p)ouchdb view params you want
  }
})

TODO

  • provide standalone builds
  • documentation

Development

To run the unit tests:

npm test

License

Copyright (c) 2014 Clemens Stolle Licensed under the MIT license.

Keywords

FAQs

Package last updated on 17 Jun 2014

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