0.4.0 • Published 8 years ago

couch-asdesigndoc v0.4.0

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

couch-asdesigndoc

Transform functions inside a Design Doc object to strings suitable for CouchDB

Installation

$ npm install couch-asdesigndoc

Example

const asDesignDoc = require('couch-asdesigndoc')
const PouchDB = require('pouchdb-node')
let db = new PouchDB('example')

db.put(asDesignDoc({
  _id: '_design/test',
  views: {
    simple: {
      map(doc) { emit(doc.date, doc.title) }
    }
  }
})