Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

couchdb-view-tester

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

couchdb-view-tester

Your friendly helper to quickly iterate on CouchDB views

  • 3.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

couchdb-view-tester

Your friendly helper to quickly iterate on CouchDB views

CLI usage

# npm install -g couchdb-view-tester
couchdb-view-tester <db url> [--watch] --map=<path to map function> --reduce=<path to reduce function> <view options>

Example

Give your CouchDB database you want to test your map/reduce function on is accessible at http://localhost:5984/mydb, do

couchdb-view-tester http://localhost:5984/mydb --map=./path/to/map.js --reduce=./path/to/reduce.js --limit=3

Both, map.js and reduce.js must return an anonymous function, for example

// map.js
module.exports = function(doc) {
  if (doc.Type == "customer") {
    emit(doc._id, doc.LastName);
  }
}
// reduce.js
function (key, values, rereduce) {
  return sum(values);
}

View options

Options are equal to PouchDB's db.query options: http://pouchdb.com/api.html#query_database

Future plans / ideas

  • add support for built in reduce functions
  • add support for map functions only
  • add docs for usage via require('couchdb-view-tester')
  • add yours™

FAQs

Package last updated on 27 May 2015

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