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

memcache-plus

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memcache-plus - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

8

lib/client.js

@@ -278,8 +278,12 @@ /**

*/
Client.prototype.getMulti = function(keys, cb) {
Client.prototype.getMulti = function(keys, opts, cb) {
var self = this;
assert(keys, 'Cannot get without key!');
if (typeof opts === 'function' && typeof cb === 'undefined') {
cb = opts;
opts = {};
}
return Promise.props(R.reduce(function(acc, key) {
acc[key] = self.run('get', [key], null);
acc[key] = self.run('get', [key, opts], null);
return acc;

@@ -286,0 +290,0 @@ }, {}, keys)).nodeify(cb);

{
"name": "memcache-plus",
"version": "0.1.6",
"version": "0.1.7",
"description": "Better memcache for node",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -178,2 +178,29 @@ require('chai').should();

it('getMulti works with compression', function() {
var key1 = getKey(), key2 = getKey(),
val1 = chance.word(), val2 = chance.word();
return Promise.all([cache.set(key1, val1, { compressed: true }), cache.set(key2, val2, { compressed: true })])
.then(function() {
return cache.getMulti([key1, key2], { compressed: true });
})
.then(function(vals) {
vals.should.be.an('object');
vals[key1].should.equal(val1);
vals[key2].should.equal(val2);
});
});
it('get works with a callback', function(done) {
var key = getKey(), val = chance.word({ length: 1000 });
return cache.set(key, val, { compressed: true })
.then(function() {
cache.get(key, { compressed: true }, function(err, v) {
val.should.equal(v);
done(err);
});
});
});
it('get for key that should be compressed but is not returns null', function() {

@@ -180,0 +207,0 @@ var key = getKey(), val = chance.word({ length: 1000 });

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