1.0.0 • Published 8 years ago
pull-couch v1.0.0
pull-couch
Parse the rows out of a couchdb views query without
parsing it as one large json object. instead split based on the format couchdb happens to use (delimited by \r)
and then parse each line with JSON.parse
.
This is much faster than parsing everything with a streaming parser (if implemented in js),
such as JSONStream
this module is a pull-stream
example
var pull = require('pull-stream')
var toPull = require('stream-to-pull-stream')
var Couch = require('pull-couch')
pull(
toPull.source(request('https://skimdb.npmjs.com/registry/_all_docs')),
Couch(function (header) {
//the headers are pased to this cb
console.log('header', header)
}),
//the rest of the data is streamed out.
pull.drain(console.log)
)
License
MIT
1.0.0
8 years ago