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

couchdb-view-cache-stream

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

couchdb-view-cache-stream - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

12

lib/index.js

@@ -7,2 +7,3 @@ var url = require('url')

var from = require('from2')
var clone = require('lodash.clonedeep')

@@ -18,4 +19,9 @@ module.exports = function (view_url, opts) {

if (err) return ready(err)
if (last_etag === resp.headers.etag) return ready(null, from.obj(current_view))
if (last_etag === resp.headers.etag) {
// clone on the way out
var dapipe = from.obj(current_view).pipe(through.obj(function (data, enc, cb) {
cb(null, clone(data))
}))
return ready(null, dapipe)
}
var tempdb = []

@@ -26,3 +32,3 @@ var dapipe = request(view_url).pipe(jsonfilter('rows.*'))

tempdb.push(data.value)
cb(null, data.value)
cb(null, clone(data.value))
}, function (cb) {

@@ -29,0 +35,0 @@ last_etag = resp.headers.etag

{
"name": "couchdb-view-cache-stream",
"version": "3.0.0",
"version": "3.0.1",
"description": "An experimental way to cache the results of a couchdb view",

@@ -9,2 +9,3 @@ "main": "lib/index.js",

"jsonfilter": "^1.1.2",
"lodash.clonedeep": "^3.0.2",
"ndjson": "^1.4.1",

@@ -11,0 +12,0 @@ "request": "^2.58.0",

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