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

@keyv/redis

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

@keyv/redis - npm Package Compare versions

Comparing version 1.3.8 to 2.0.0

13

package.json
{
"name": "@keyv/redis",
"version": "1.3.8",
"version": "2.0.0",
"description": "Redis storage adapter for Keyv",

@@ -8,2 +8,4 @@ "main": "src/index.js",

"test": "xo && nyc ava",
"test:docker": "docker-compose up --build --abort-on-container-exit --exit-code-from test",
"posttest:docker": "docker-compose down --rmi local",
"coverage": "nyc report --reporter=text-lcov | coveralls"

@@ -41,8 +43,7 @@ },

"dependencies": {
"pify": "3.0.0",
"redis": "2.8.0"
"ioredis": "~4.14.1"
},
"devDependencies": {
"ava": "^0.22.0",
"coveralls": "^2.13.1",
"ava": "^0.25.0",
"coveralls": "^3.0.0",
"delay": "^2.0.0",

@@ -55,4 +56,4 @@ "eslint-config-xo-lukechilds": "^1.0.0",

"this": "^1.0.2",
"xo": "^0.19.0"
"xo": "^0.20.1"
}
}

@@ -28,3 +28,3 @@ # @keyv/redis [<img width="100" align="right" src="https://rawgit.com/lukechilds/keyv/master/media/logo.svg" alt="keyv">](https://github.com/lukechilds/keyv)

Any valid [`redis.createClient()`](https://github.com/NodeRedis/node_redis#rediscreateclient) options will be passed directly through.
Any valid [`Redis`](https://github.com/luin/ioredis#connect-to-redis) options will be passed directly through.

@@ -31,0 +31,0 @@ e.g:

'use strict';
const EventEmitter = require('events');
const redis = require('redis');
const pify = require('pify');
const Redis = require('ioredis');

@@ -10,3 +9,2 @@ class KeyvRedis extends EventEmitter {

super();
this.ttlSupport = true;
opts = Object.assign(

@@ -17,14 +15,5 @@ {},

);
if (opts.uri && typeof opts.url === 'undefined') {
opts.url = opts.uri;
}
const client = redis.createClient(opts);
this.redis = ['get', 'set', 'sadd', 'del', 'srem', 'smembers'].reduce((obj, method) => {
obj[method] = pify(client[method].bind(client));
return obj;
}, {});
client.on('error', err => this.emit('error', err));
this.redis = new Redis(opts.uri, opts);
this.redis.on('error', err => this.emit('error', err));
}

@@ -70,3 +59,3 @@

return this.redis.smembers(this._getNamespace())
.then(keys => this.redis.del.apply(null, keys.concat(this._getNamespace())))
.then(keys => this.redis.del(keys.concat(this._getNamespace())))
.then(() => undefined);

@@ -73,0 +62,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