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

dt-koa-redis

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dt-koa-redis - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

2

dist/index.js

@@ -52,2 +52,4 @@ "use strict";

var generic_pool_1 = require("generic-pool");
var bluebird_1 = require("bluebird");
bluebird_1.Promise.promisifyAll(redis_1.RedisClient.prototype);
var debug = require('debug')('redis');

@@ -54,0 +56,0 @@ var defaultOptions = {

4

package.json
{
"name": "dt-koa-redis",
"version": "1.0.0",
"version": "1.1.0",
"description": "Redis middleware for koa2",

@@ -16,2 +16,3 @@ "main": "dist/index.js",

"dependencies": {
"bluebird": "^3.7.2",
"debug": "^4.3",

@@ -25,2 +26,3 @@ "generic-pool": "^3.1",

"devDependencies": {
"@types/bluebird": "3.5.35",
"@types/generic-pool": "3.1.9",

@@ -27,0 +29,0 @@ "@types/koa": "2.13.1",

## koa-redis
koa-redis is a mongodb middleware for koa@2, using redis and bluebird, support connection pool, inspired by koa-mongo middleware https://github.com/nswbmw/koa-mongo. It's written in Typescript and support koa2 async / await syntax.
koa-redis is a redis middleware for koa@2, inspired by koa-mongo middleware https://github.com/nswbmw/koa-mongo. It's written in Typescript and support koa2 async / await syntax.
It provides a promisified wrapper for [node-redis](https://github.com/NodeRedis/node-redis) client using bluebird.
### Usage

@@ -16,14 +18,3 @@

}));
```
### Example
```
'use strict';
import koa from 'koa';
import koaRedis from 'dt-koa-redis';
const app = new koa();
app.use(koaRedis());
app.use(async (ctx, next) => {

@@ -40,6 +31,2 @@ try {

});
app.listen(3000, () => {
console.log('listening on port 3000');
});
```

@@ -46,0 +33,0 @@

import { createClient, RedisClient } from 'redis';
import { createPool } from 'generic-pool';
import { Context, Next } from 'koa';
import { Promise as PromiseLib } from 'bluebird';
PromiseLib.promisifyAll(RedisClient.prototype);
const debug = require('debug')('redis');

@@ -53,2 +56,3 @@

});
client.on('ready', () => {

@@ -55,0 +59,0 @@ resolve(client);

Sorry, the diff of this file is not supported yet

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