0.0.4 • Published 12 years ago

node-stream-cache v0.0.4

Weekly downloads
3
License
-
Repository
github
Last release
12 years ago

node-stream-cache

Stream things in and out of a redis cache

Example

var Cache = require('./index.js')
  , cacher = new Cache
  , request = require('request')
  , JSONStream = require('JSONStream')
  , es = require('event-stream')

var work = function () {
  var parser = JSONStream.parse(['rows', true])
    , req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'})

  req.pipe(parser)
  return parser
}

var done = function (stream) {
  stream.pipe(es.mapSync(function (data) {
                console.error(data)
                return data
              }))
}

cacher.process('docs', work, done, 60)
0.0.4

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago